get time from now()

spinkung

Registered User.
Local time
Today, 17:16
Joined
Dec 4, 2006
Messages
267
Hi again.

I'm trying to pass a value based on whther a time is before 12:30pm or after 12:30pm.

I have used the now() function on a field called date received.

I want to say if [date received] < 12:30pm then 5 else 6

Can someone tell me to extract the time from the Now() function please.


here's what i've got so far but it doesn't work.
Code:
Due Date: IIf([In-Spec / Out of Spec]=1 AND format([received date],"hh:nn:ss:"< 12:30:00),dateaddw([date received],5),dateaddw([date received],6))

ta.
spinkung.
 
Last edited:
Hello:

You want to use the Hours, Minutes, and Seconds function along with the Now function to extract the time.

Syntax

Hour(time)


Regards
Mark
 
If [date received] - Int([date received]) < #12:30:00 PM# Then


Peter
 
Forgive me for asking but if only requires the time why can he not use the Time() function?

Brian
 
I was assuming that he is using Now() to create a date time stamp in [date received]and wants the time portion of that stamp

Peter
 
Hum I suppose the name [date received] is a clue,:o , well it is saturday.:)

Brian
 
to get the time from a timestamp there is a quick trick you can use if you realize that the time part is actually a decimal... and the datepart is an integer. Together they make a double.

Time: [date received] - int([date received])

or (maybe)

Time: mod([date received],1)

or something simular to extract the decimal point(s) from the double....:D
 

Users who are viewing this thread

Back
Top Bottom