[thelist] SQL Query Question

Twitchell, Lucy c-ltwitche at state.pa.us
Wed Aug 13 14:18:41 CDT 2003


Eric Schwake wrote on Wednesday, August 13, 2003 1:58 PM:
> So in other words I need to figure out how to look 
> at their StartDate, compare it to the current date,
> and then display in the DaysLeft how many days of 
> their 90 days they have left?

Hi, Eric -

Are you familiar with the DateDiff function? 

For example, this line:
  DaysLeft = DateDiff("d", StartDate, Now)
will return the number of days between the current date
and the date value in the StartDate variable.

If StartDate is June 4, 2003, and the code is running on
August 13, 2003, the result will be 70. The "d" indicates 
that the answer is to be returned in a number of days, 
rather than some other time increment.

Happy Coding,

Lucy


More information about the thelist mailing list