|
-
Aug 6th, 2003, 02:37 PM
#1
Thread Starter
Addicted Member
DateDiff Problem
Hi.
I want to determine how long a month is, but when I do this
Code:
strLeft = 8/31/2003
varMonthLength = DateDiff("d", CDate(strLeft), DateAdd("m", 1, CDate(strLeft)))
I get 30 instead of 31, what can cause that to happen?, and how I can get the accurate number?
Thanks in advance.
-
Aug 6th, 2003, 02:45 PM
#2
Thread Starter
Addicted Member
Um, hehehe, my mistake, I know what is happening
-
Aug 6th, 2003, 11:32 PM
#3
Frenzied Member
Tell us .. what is happening!!!
-
Aug 7th, 2003, 12:27 AM
#4
Lively Member
Try this:
VB Code:
strLeft = "8/31/2003"
varMonthLength = Day(DateSerial(Year(CDate(strLeft)), Month(CDate(strLeft)) + 1, 0))
Diego.
-
Aug 7th, 2003, 01:38 AM
#5
It is just because september (month number 9) has only 30 days. If you add 1 month to 31-8-2003 you get 30-9-2003
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|