Time Syntax in query

message from John on 7 May 2004
Hi

I am using the this time syntax in an acess query; iif([Setup
Time]>=#12:00:00 PM#,"PM","AM"). Problem is that I am getting error on the
date expression. What is the correct expression to represent 12 noon in an
access query?

Thanks

Regards
 
Graham R Seach replied to John on 7 May 2004
John,

IIf(Format([SetupTime],"hh:nn:ss")>TimeSerial(0,0,0),"PM","AM")

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html

"John" <john@nospam.infovis.co.uk> wrote in message
news:uM1fqF9MEHA.2996@TK2MSFTNGP12.phx.gbl...
 
John replied to Graham R Seach on 7 May 2004
Did you mean TimeSerial(12,0,0) in the expression ?

Regards

"Graham R Seach" <gseach@NOSPAMpacificdb.com.au> wrote in message
news:OBFeY29MEHA.2540@TK2MSFTNGP10.phx.gbl...
 
Graham R Seach replied to John on 10 May 2004
John,

Sorry. Yes, that should have been TimeSerial(12,0,0).

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html

"John" <john@nospam.infovis.co.uk> wrote in message
news:OGgpE0$MEHA.3944@tk2msftngp13.phx.gbl...
 
Van T. Dinh replied to John on 8 May 2004
TestTime = #12:01:00 PM#
?Iif(TestTime >= #12:00:00 PM#, "PM", "AM")
PM

The problem may be some other expressions or the Reference Errors.

Check Douglas J. Steele's article:

http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 

Archived message: Time Syntax in query (MS Access Database)