1 Reply Latest reply on May 26, 2006 4:08 PM by Dan Bracuk

    Disallowed implicit conversion from data type datetime to data type timestamp

    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
        • 1. Re: Disallowed implicit conversion from data type datetime to data type timestamp
          Dan Bracuk Level 5
          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.