Re: Using cdate function to display data under criteria by Evertjan
Evertjan
Fri Jul 07 15:59:01 CDT 2006
wrote on 07 jul 2006 in microsoft.public.inetserver.asp.general:
> Hello -
> I'm new to the groups here, so bear with me :) I am trying to
> change an existing function that currently only displays records that
> fall under a criteria of
>
> NOT(now>cdate(OTDate & ' 2:00 AM')
>
> If I wanted to change this function to display entries that are before
> 6:00 pm the day before the OTDate, how could I modify this part of my
> code? should is be something like this...
>
> NOT(now>cdate((OTDate -1) & ' 6:00 PM')
You would not need the outer () here
NOT a>b
is the same as:
a<=b
and since exact equality on the milisecond is unimportant
in a real time testing like below,
that is the same here as:
a<b
================================
I would never make a date by concatenating strings,
and I would never use am/pm.
So no need for cdate here.
================================
try:
OTDate = #2006/7/8# 'tomorrow
if now < dateadd("h",2,OTDate) then
duty = "John" 'before 2 am for Americans
elseif now < dateadd("h",18,OTDate) then
duty = "Pete" 'between 2 am and 6 pm for Americans
else
duty = "Bill" 'after 6 pm for Americans
end if
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)