By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,131 Members | 1,728 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,131 IT Pros & Developers. It's quick & easy.

calculating the amount of days between 2 dates...

P: n/a
Hi All

I have an application that has a start date and a finish date I need to
calculate the number of days from the start date to the end date and then
display this in a read only text box... How might I code this?...

Regards

Scott
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Scott" <ho*******@virgin.net> schrieb:
I have an application that has a start date and a finish date I need to
calculate the number of days from the start date to the end date and then
display this in a read only text box... How might I code this?...


\\\
Dim d1 As Date = #12/22/1999#
Dim d2 As Date = Now()
Me.TextBox1.Text = CStr(d2.Subtract(d1).Days)
///

Alternatively you can use 'DateDiff' to calculate the difference between two
dates.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2

P: n/a
"Scott" <ho*******@virgin.net> schrieb:
I have an application that has a start date and a finish date I need to
calculate the number of days from the start date to the end date and then
display this in a read only text box... How might I code this?...


\\\
Dim d1 As Date = #12/22/1999#
Dim d2 As Date = Now()
Me.TextBox1.Text = CStr(d2.Subtract(d1).Days)
///

Alternatively you can use 'DateDiff' to calculate the difference between two
dates.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.