Hi Rob,
I tried something like this and it worked fine for me:
Here is my stored proc in sql 2000 which inserts a datetime value into a
table testdate:
CREATE procedure updatedate
@startdate datetime
as
begin
insert into testdate values (@startdate);
end
GO
And here is the coldfusion code that I used to execute the stored proc:
<cfset foo = createDateTime(2000, 1 , 1 , 0, 0, 0)>
<cfstoredproc procedure="updatedate" datasource="testtrigger"
username="sa" password="admin">
<cfprocparam type="IN" cfsqltype="cf_sql_date" value=#foo#>
</cfstoredproc>
This one worked without any hassles. Are you doing anything different
from this? If yes, can you post the code here?
-----Original Message-----
From: Rob Parkhill [mailto:[EMAIL PROTECTED]
Sent: 21 August 2007 03:08
To: CF-Talk
Subject: Formatting a Date for MSSQL
I have been banging my head against the wall all afternoon. I am trying
to update a table in SQL 2000 with a date time column using a stored
procedure. The procedure is set to recieve the variable as a Datetime
format for SQL, I am sending it as a CF_SQL_Date type and have used
about as many combinations of creating the date that I can think of...
CreateDate - CreateDateTime - CreateODBCDate -CreateODBCDatetime
They all give me the same error that a variable of type varchar cannot
be converted to datetime - in the stored procedure. So the variable
itself is what? a varchar??? even though it should be a datetime... I
have done some googling, but to no avail...
If anyone can shed some light for me, that would be great!
Thanks,
Rob
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286660
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4