Remove the single quotes around #createODBCDate(Now())#
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 30, 2007 12:21 PM
To: CF-Talk
Subject: need help with updating
The word Date is a reserved word. It is good practice to avoid naming
fields with a reserved word. In this case, wrap it in hard brackets such as
[date] = '#createODBCDate(now())#'
HTH
Steve
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May
Date = '#createODBCdate(Now())#'
Tow things here: first a date value needs no quotes in SQL, then use
this instead:
Date = #createODBCdate(Now())#
Secondly, Date is a reserved word in several db systems, it would be a
good idea to use another field name.
--
You are missing a comma after '#form.Fax#'
Marius Milosav
ScorpioSoft Corp.
www.scorpiosoft.com
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: May 30, 2007 12:21 PM
To: CF-Talk
Subject: need help with updating date field
I know this is probably obvious to
You are missing a comma after Fax = '#form.Fax#'
Should read Fax = '#form.Fax#',
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: 30 May 2007 17:21
To: CF-Talk
Subject: need help with updating date field
I know this is probably obvious to most of you here, but
I think it should be:
Date = #createODBCdate(Now())#,
HTH
Will
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: 30 May 2007 17:21
To: CF-Talk
Subject: need help with updating date field
I know this is probably obvious to most of you here, but I have an error
I know this is probably obvious to most of you here, but I
have an error on an update statement that I need some
enlightenment on please. I'm using MSSQL2k, CFMX7 and I have
an insert statement that works fine using
#createODBCdate(Now())# but my update bombs on it??
First, the Now
oooh. good catch :)
On 5/30/07, Marius Milosav [EMAIL PROTECTED] wrote:
You are missing a comma after '#form.Fax#'
Marius Milosav
ScorpioSoft Corp.
www.scorpiosoft.com
-Original Message-
From: Imperial, Robert [mailto:[EMAIL PROTECTED]
Sent: May 30, 2007 12:21 PM
To: CF-Talk
first off, DATE is a reserved word and probably shouldn't be used as a
column name. if you can't change it, at least enclose it in brackets
([DATE])
in your SQL, remove the single quotes from the #createODBCDate(now())# value.
also, look into using cfqueryparam (hey if i didn't say it, somebody
!
---
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 30, 2007 12:28 PM
To: CF-Talk
Subject: Re: need help with updating date field
first off, DATE is a reserved word
: Wednesday, May 30, 2007 12:28 PM
To: CF-Talk
Subject: Re: need help with updating date field
first off, DATE is a reserved word and probably shouldn't be used as a
column name. if you can't change it, at least enclose it in brackets
([DATE])
in your SQL, remove the single quotes from
:48 PM
To: CF-Talk
Subject: RE: need help with updating date field
Wow... that was just one messed up query I guess heh. I stopped with the
first error I saw... so to recap class...
UPDATE AdminPersonnel
SET First_Name = '#form.First_Name#',
Last_Name
Thanks all for the quick responses, I've changed the field name from Date to
AccessDate, makes more sense too. I used cfqueryparam on my insert and just
trying to get this thing to work in the raw first ;). As for using jdbc instead
of odbc, I have yet to get cf to register the ds using the SQL
First, the Now function returns an ODBC timestamp
Are you sure of that?
Now () is supposed to return a date-time object which is a foating point
value, not an ODBC date.
But it is possible that it will be automatically converted to an
ODBCDate by the CFQUERY tag.
And if it does so, then it is
Are you sure of that?
Now () is supposed to return a date-time object which is a
foating point value, not an ODBC date.
You can easily test this:
cfoutput#Now()#/cfoutput
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber
Thanks all for the quick responses, I've changed the field
name from Date to AccessDate, makes more sense too. I used
cfqueryparam on my insert and just trying to get this thing
to work in the raw first ;). As for using jdbc instead of
odbc, I have yet to get cf to register the ds using
You can easily test this:
cfoutput#Now()#/cfoutput
This only shows that CFOUTPUT formats a date-time object as an ODBC
dateTime stamp by default, not that Now() returns it.
If it was so, then Now() + 1 would cause an error, since one cannot add
a number to a string.
Try
It's often easier to use CFQUERYPARAM, actually - for example, you don't
have to worry about single quotes.
But if you want only a date, with no time, you still need to use
CreateODBCDate () to format the date properly for CFQUERYPARAM,
then it is is not that much easier.
--
This only shows that CFOUTPUT formats a date-time object as
an ODBC dateTime stamp by default, not that Now() returns it.
CFOUTPUT doesn't format anything. It outputs values of expressions.
If it was so, then Now() + 1 would cause an error, since one
cannot add a number to a string.
Try
CF casts datatypes when necessary in an expression. I don't see how
this is
any different from any other casting in CF.
This is what I meant.
CFOUTPUT cannot output anything else than a string, then the expression
between #...# must be converted to a string before it can be processed.
Since
20 matches
Mail list logo