you need to make the same format on both sides of the SQL where clause
so try:
<cfset dayview = #createODBCDate(createdate(year, month, thisday))#>
On 22/05/2011 12:15, Kevin Parker wrote:
>
> I love CF but dates are definitely my Achilles heel.
>
> I've dumped qEvents.TheDate and its formatted like {ts '2011-06-07
> 00:00:00.0'}
>
> I've dumped dayview and its formatted like {ts '2011-06-07 00:00:00'}
>
> I would have thought that as time stamps CF would see these the same despite
> the 0 difference but the query returns no rows and I'm stumped. A cfdump of
> qEvents shows the query is returning data correctly. Funny thing is this
> works on a CF6 box running SQL2000 but fails on a CF8 box running SQL2005.
> What I'm trying to do is do a check for qEvents that on a given day there
> are or are not events for that day (thisday). Any advice greatly appreciated
> - thank you.
>
> <cfset dayview = #createdate(year, month, thisday)#>
>
> <cfquery name="ForToday" dbtype="query">
> select *
> from qEvents
> where qEvents.TheDate = #dayview#
> </cfquery>
>
>
--
Yours,
Kym Kovan
mbcomms.net.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344813
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm