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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top