Question
Date Problem
I define todays date with
<cfset todays_date=dateformat(now(),"mm/dd/yyyy")>
I then do a sql insert into a field called date_submitted into an access table, with date_submitted defined as a long date.
I then want to report all records submitted each day, using
<cfquery name="qryName" datasource="db_name">
sele.ct * from tblName
where date_submitted = #todays_date#
</cfquery>
No records are found. I remove the where clause and display the dates only and for date_submitted, it is 19-Apr-06 and todays_date is 04/19/2006. I redefine todays_date with dd-mmm-yy and still no records are found. I know there are records that match. But I do not know what is going on.
To accomplish what I want, I just select all records from the table regardless of date and put all records into a temp table, then do the where clause again, and it works. I do not know why it works this way and not with the table itself.
Please help, any ideas on what to do ? thanks
<cfset todays_date=dateformat(now(),"mm/dd/yyyy")>
I then do a sql insert into a field called date_submitted into an access table, with date_submitted defined as a long date.
I then want to report all records submitted each day, using
<cfquery name="qryName" datasource="db_name">
sele.ct * from tblName
where date_submitted = #todays_date#
</cfquery>
No records are found. I remove the where clause and display the dates only and for date_submitted, it is 19-Apr-06 and todays_date is 04/19/2006. I redefine todays_date with dd-mmm-yy and still no records are found. I know there are records that match. But I do not know what is going on.
To accomplish what I want, I just select all records from the table regardless of date and put all records into a temp table, then do the where clause again, and it works. I do not know why it works this way and not with the table itself.
Please help, any ideas on what to do ? thanks