In the function CreateDateTime(year, month, day, hour, minute, second) the combination of the arguments, which are 2010- 2-30 0: 0: 0, have resulted in an invalid date value. The valid range of dates approximately covers the period between 100 AD and 9999 AD

The error occurred while processing an element with a general identifier of (CFSET), occupying document position (7:2) to (7:81).

Not sure if I need to give more code here or not. Can anyone see anything to correct this?

system
—
2010-07-02T06:41:39Z —
#2

Yeah, I wouldn't wait either. But then I don't like those kind of surprises

Also, you might post your final code to help anyone reading this thread in the future.

Mittineague
—
2010-07-01T21:59:30Z —
#3

I wouldn't wait on the calendar to roll around. I'd take the date, manipulate it to the test date, and test using that.

Up to you of course, maybe you're busy enough and/or have lots of patience.

capescafe
—
2010-07-01T21:29:26Z —
#4

Ok thanks. It works today but that's because it's the 1st. I guess I'll have to wait now until the end of this month to try fixing it.

Thanks for the input.

system
—
2010-07-01T00:27:30Z —
#5

Hm... or maybe you're trying to find today's date in another month/year? I'm not sure what's the best approach for that. Maybe using DateDiff() to find the wholes months difference. Then using DateAdd(..) to subtract the number of months to calculate the desired date.

system
—
2010-06-30T21:55:05Z —
#6

which are 2010- 2-30 0: 0: 0, have resulted in an invalid date value.

The month of February doesn't have 30 days ... ever

CreateDateTime(#form.year#, #form.month#, #day(now())#, 00,00,00)

day(now())# won't work in a few cases. Not just february. If you want the last day of the month, determine the first of the month. Then use it to calculate the last day of the month with date functions. In psuedo code, somethin like