I'm working on a template intended to display current events. Each event can be scheduled with an effective and expiration date.
The QUERY:
<cfquery name="shwList" datasource="deco" dbtype="odbc">
select *
from mthSaleEvent
where (#dateformat(mthEffective,"mm/dd/yyyy"
# >= #dateformat(now(),"mm/dd/yyyy"
#)
AND (#dateformat(mthExpires, "mm/dd/yyyy"
# <= #dateformat(now(),"mm/dd/yyyy"
#)
order by mthExpires
</cfquery>
Fields in DB are set to date/time format. I read some posts in this forum and found that to guarantee consistancy, I would need to use dateformat() ...
Please help me figure out what's wrong with above query!
Thank you all in advance;
josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours
The QUERY:
<cfquery name="shwList" datasource="deco" dbtype="odbc">
select *
from mthSaleEvent
where (#dateformat(mthEffective,"mm/dd/yyyy"
AND (#dateformat(mthExpires, "mm/dd/yyyy"
order by mthExpires
</cfquery>
Fields in DB are set to date/time format. I read some posts in this forum and found that to guarantee consistancy, I would need to use dateformat() ...
Please help me figure out what's wrong with above query!
Thank you all in advance;
josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours