Skip to main content
Participant
May 26, 2006
Question

Disallowed implicit conversion from data type datetime to data type timestamp

  • May 26, 2006
  • 1 reply
  • 896 views
Received error: [Macromedia][SQLServer JDBC Driver][SQLServer]Disallowed implicit conversion from data type datetime to data type timestamp, table 'myTbl', column 'duration'. Use the CONVERT function to run this query.

I have a field named duration hh:mm:ss.lll that I am trying to insert into MS SQL. DB has field defined as [duration] [timestamp] NOT NULL,

My insert has this: INSERT INTO myTbl( duration) VALUES( <cfqueryparam value="2006-05-26 11:12:13" cfsqltype="CF_SQL_TIMESTAMP"/> )

Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with seconds as 13.111 which did not work. Does the db duration need to be date? I just want to store a duration for the time of a movie... 10 Q
This topic has been closed for replies.

1 reply

Inspiring
May 26, 2006
quote:

Originally posted by: quiet1
Received error: [Macromedia][SQLServer JDBC Driver][SQLServer]Disallowed implicit conversion from data type datetime to data type timestamp, table 'myTbl', column 'duration'. Use the CONVERT function to run this query.
I have a field named duration hh:mm:ss.lll that I am trying to insert into MS SQL. DB has field defined as [duration] [timestamp] NOT NULL,
My insert has this: INSERT INTO myTbl( duration) VALUES( <cfqueryparam value="2006-05-26 11:12:13" cfsqltype="CF_SQL_TIMESTAMP"/> )
Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with seconds as 13.111 which did not work. Does the db duration need to be date? I just want to store a duration for the time of a movie... 10 Q


Duration as a timestamp? How odd, most people would store it as an integer. Or, if you want to build your own string, the syntax is {ts 'yyyy-mm-dd hh:mm:ss'}. The seconds might not be required.

In any event, use createodbcdatetime() for the value you want to put into your table.