Thats fine as long as you're _sure_ of the date format you're getting (i.e
mm/dd/yyyy).
Better would be to CreateDate, then CreateODBCdate that:

<cfset mydate = "3/22/2001">
<cfset mydate =
CreateDate(ListLast(mydate,'/'),ListGetAt(mydate,2,'/'),ListLast(mydate,'/')
)>
<cfset myODBCdate = CreateODBCDate(mydate)>

<CFQUERY....>
    UPDATE mytable
    SET    mydate = #myODBCdate#
</CFQUERY>

(Cos its an ODBC date you don't need the single quotes)

This is because CreateDate will 'helpfully' try first the mm/dd/yyyy format,
then if that fails, it'll try using the english format of dd/mm/yyyy, but if
you use CreateDate then you _know_ you won't get any unexpected results.
You'll just get errors.

Bert

> -----Original Message-----
> From: Smith, Vincent [mailto:[EMAIL PROTECTED]]
> Sent: 22 March 2001 18:38
> To: Fusebox
> Subject: RE: Date Type for SQL Server
> 
> 
> Try #CreateODBCDateTime(yourdatevalue)#
> 
> -----Original Message-----
> From: David Huyck [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 22, 2001 12:06 PM
> To: Fusebox
> Subject: OT: Date Type for SQL Server
> 
> 
> Okay, quick question:  In Access you can pass date/time in 
> your SQL query
> like this:
> #3/22/2001#
> 
> How do I do the same thing in SQL server?  It seems to 
> dislike the #pound
> signs#...  I know I've seen this question answered before, I 
> just don't
> remember what the answer was...
> 
> Thanks,
> David Huyck
> [EMAIL PROTECTED]
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to