Hi Hatton,

Don't know what you mean by your second statement... Make sure that times
are being figured....

The dates are being entered into the DB with CreateODBCDateTime(Now()).

James

-----Original Message-----
From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2003 2:01 PM
To: CF-Talk
Subject: RE: Query help - Selecting record based on date


Hi James,

You might want to take a look at the following things:

First of all, if you're only dealing with dates, take a look at the syntax
for the DATEDIFF function in SQL Server and utilize it... it will return a
better result set than using the LIKE and BETWEEN comparisons.

Secondly, you need to make sure that times are being figured in without your
knowledge, sometimes that happens.

Hope this points you in the right direction!

Until Later!
Hatton Humphrey


-----Original Message-----
From: James Johnson [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 21, 2003 4:28 PM
To: CF-Talk
Subject: Query help - Selecting record based on date

Hi,

I'm building an app that needs to retrieve records from a SQL Server table
based on a record's date.

The date values in the table are in the format of m/d/y h:m:s AM/PM
(8/4/2003 1:02:16 PM).

The tool I'm building allows the user to input a date range in the format of
08/04/2003 to 08/30/2003.

So, for instance a record has the date value of 8/4/2003 1:02:16 PM. I want
to pass in 08/01/2003 (date1) and 08/15/2003 (date2) and find that record.

I've tried converting the date with ParseDateTime(), which didn't work and
trying LIKE '%#date1#%' which didn't work either.

Suggestions? The data in the table can't be changed, as it was generated by
a tool already in production.

Thanks,
James



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137810
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to