Hi:
I want to do a date range statement in my SQL query. I am using:
WHERE ESC.discov_date=Between date('9/18/03') AND date('9/19/03')
and it doesn't work. Does anyone know the correct statement Thanks
Z
First, informix doesn't require the "date" internal function like other databases. If informix can't do a legal conversion it does it. Also, your syntax is off somewhat:
WHERE ESC.discov_date between "9/18/03" AND "9/19/03"
The above 2-digit year works only if shell variable DBDATE equals MDY2/
The default for DBDATE is MDY4/ and if it's set this way it's:
WHERE ESC.discov_date between "9/18/2003" AND "9/19/2003"
WHERE discov_date BETWEEN '9/18/03' AND '9/19/03';
One thing I noted from your SQL using table name "ESC" ! It is highly recommended NOT to use any of the reserved words as an user object name or an identifier.
Here are link for more information, ebooks in pdf format:
SQL Quick Syntax Guide:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.