Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query Date Syntax

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
Pardon the simplicity of this question. In the Informix environment I am a "newbie".

I am looking to perform an SQL Query against an Informix database and I need to use the Date field as a qualifier. However many of the syntax possibilities that have worked for me in other database environments seem to fail.

Your advice and/or examples would be appreciated.

Thanks,
JRB-Bldr
 
JRB:

I think we need more information, but check out informix variable DBDATE.

Regards,

Ed
 
I want to pass a DATE to the SQL Query as part of the selection criteria.

If I use:
WHERE call_date = {07/20/03} it fails
WHERE call_date = "07/20/03" it fails
etc...

What would be the proper syntax to use?

Thanks,
JRB-Bldr
 
Hi:

assuming call_date is date type, check the shell variable DBDATE.

If it's undefined or equal MDY4/

the syntax is:

WHERE call_date = "07/30/2003"

the only other value I've seen it set to is:

MDY2/

so the syntax would be:

WHERE call_date = "07/30/03"

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top