There's something very strange going on with what seems to be a simple comparison involving DateDiff. Here's the code:
if DateDiff("d", cdateonly, date()) < timespent then
Response.Write datediff("d", cdateonly, date()) & " < " & timespent
end if
Looks fairly simple. Using the datediff function, if the number of days between "cdateonly" and the current date (using the date() function) is LESS THAN this variable called "timespent", it should print "x < timespent", where X is the result of the datediff() operation and timespent is some value received from a HTML form.
Let's say "cdateonly" is '1/1/2002' and "timespent" is '10'. The result of DateDiff would be 63. Because 63 is not less than 10, the response.write line should not be executed. Problem is, this is the kind of output I'm getting:
623 < 10
812 < 10
265 < 10
264 < 10
264 < 10
263 < 10
It seems to think EVERYTHING is less than "timespent", whether it is or not. What gives? Thanks in advance!!
if DateDiff("d", cdateonly, date()) < timespent then
Response.Write datediff("d", cdateonly, date()) & " < " & timespent
end if
Looks fairly simple. Using the datediff function, if the number of days between "cdateonly" and the current date (using the date() function) is LESS THAN this variable called "timespent", it should print "x < timespent", where X is the result of the datediff() operation and timespent is some value received from a HTML form.
Let's say "cdateonly" is '1/1/2002' and "timespent" is '10'. The result of DateDiff would be 63. Because 63 is not less than 10, the response.write line should not be executed. Problem is, this is the kind of output I'm getting:
623 < 10
812 < 10
265 < 10
264 < 10
264 < 10
263 < 10
It seems to think EVERYTHING is less than "timespent", whether it is or not. What gives? Thanks in advance!!