Chad,

OK - If that worked then what you need to do is use CreateODBCDateTime in
the SQL rather than just CreateODBCDate...

What'll be happening is that you are getting a date and time in the database
(the time is usually appended as 00:00:00) and trying to compare it to just
a date, so of course its not going to match.

Giving CreateODBCDateTime just a date will append the 00:00:00 to the end of
your date and you should get a match with your SQL query, no need for the
addition BETWEEN processing.

regards

Stephen

> -----Original Message-----
> From: list@objekt [mailto:[EMAIL PROTECTED]]
> Sent: 02 October 2001 13:59
> To: CF-Talk
> Subject: Re: where date = day problem
>
>
> Hi mike...
>
> that worked perfectly!
> I was going crazy...... thanks so much!!!!!!!!!!!
>
> regards
> chad
>
> > On the assumption that eventdatestart is a datetime object in your
> > database then the query will be looking for the date passed and time =
> > 0:00:00.  If the inserted records contain timing information on insert
> > then this will probably not return any records... Try.
> >
> > WHERE eventdatestart BETWEEN #createODBCdate(showdate)# AND
> > #createODBCdate(DateAdd("d", 1, showdate))#
> >
> > HTH
> >
> > Mike
> >
> > -----Original Message-----
> > From: list@objekt [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 2, 2001 13:29
> > To: CF-Talk
> > Subject: where date = day problem
> >
> >
> > hi everyone....
> >
> > I am trying to do a query that will just show me events for a chosen
> > day.
> >
> > i have an output like this...
> >
> > <cfoutput query="days">
> > <CFSET yourDate = CreateDate(years, months, days)>
> >  <a href="index.cfm?showDate=#URLEncodedFormat(yourDate)#">
> > #DateFormat(yourDate, "dd/mmm [dddd]")#
> > </a>
> >  </cfoutput>
> >
> > which gives me a urlencoded date format
> >
> > I then want to pass this to a query to show all events for that day.
> >
> > <cfquery name="events" datasource="#DSN#" dbtype="ODBC">
> > SELECT *
> > FROM events
> > WHERE eventdatestart = #createODBCdate(showdate)#
> > ORDER BY eventdateStart
> > </cfquery>
> >
> > I am not getting an error, but no results are being returned.
> > I have tried also tried '#createODBCdate(showdate)#' (with single
> > quotes)
> >
> > this should be so simple but i cant get results!?
> >
> > any help is appreciated.
> >
> > thanks
> > chad
> >
> >
> >
> >
> >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to