> > The following should work for both Access and SQL Server.
> >
> > Since Now() is already in ODBC format, inserting it is dead simple:
> >
> > <CFQUERY NAME="qryInsertDateTime" DATASOURCE="some_dsn">
> >         INSERT INTO some_table (column_name)
> >                 VALUES (#Now()#)
> > </CFQUERY>
>
> Doesn't INSERT here for SQL Server 7 sp1, NT4sp6a
>
> I need to use VALUES (#CreateODBCDateTime(Now())#)
>
> best,  paul
>
> PS> My recollection is my above is needed for Access, too.

Cut that out!

Seriously, you can avoid all this by using the native SQL functions:

INSERT INTO some_table (date_column)
        VALUES (GETDATE())

Better yet, if you've got a field which, when a record is inserted, always
is filled with the current date/time, make that a default in your data
design; that way, you move the responsibility for managing that to the
database itself.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to