Time Syntax in query

  • Thread starter Thread starter John
  • Start date Start date
J

John

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
 
Did you mean TimeSerial(12,0,0) in the expression ?

Regards

Graham R Seach said:
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 said:
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
 
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 said:
Did you mean TimeSerial(12,0,0) in the expression ?

Regards

Graham R Seach said:
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 said:
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
 
Back
Top