Results 1 to 1 of 1

Thread: bindValue string to datetime db field

  1. #1
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Question bindValue string to datetime db field

    Hi
    I have strange problem.
    I use bindValue to bind date ( saved in qstring, format yyyy-MM-dd ) to db datetime field.
    And I get error: Arithmetic overflow error converting expression to data type datetime.
    If I write this in this way: bindValue( ":dateFrom", "2009-01-01" ) it is correct.
    If I write this in that way: bindValue( ":dateFrom", elem.getDateFrom() ) it is error.
    def of getDateFrom(): const QString& getDateFrom() const;
    Any ideas??

    Ok, I also use ODBC Driver... and ODBC driver need date format: yyyyMMdd
    So simple conversion do QVariant:: Date should work...
    Last edited by pmlody; 19th September 2009 at 13:07.

Similar Threads

  1. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  2. Replies: 1
    Last Post: 30th June 2006, 05:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.