macromedia.coldfusion.database_access
[Top] [All Lists]

Re: Query output based on date - Oracle 8i

Subject: Re: Query output based on date - Oracle 8i
From: "paross1" <webforumsuser@xxxxxxxxxxxxxx>
Date: Thu, 27 Mar 2008 20:07:45 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

You can use the Oracle to_date() function to convert your string to a date/time 
object:

 select * from my.table
 where startdate > to_date('2008-01-01', 'YYYY-MM-DD')

 Or, since you are using an ODBC connection to Oracle, you can try using the 
ColdFusion CreateODBCDate() function:

 select * from my.table
 where startdate > #CreateODBCDate("2008-01-01")#

 Or, as already suggested, use cfqueryparam with the appropriate CFSQLType. You 
can't use a "string" date value against a date/time column in an Oracle query, 
as it won't perform an implicit type conversion.  

 Phil


<Prev in Thread] Current Thread [Next in Thread>