Cannot perform '<=' operation on MySql.Data.Types.MySqlDateTime and System.String.

Discussion in 'Other Programming' started by hooda, Feb 1, 2012.

  1. hooda New Member

    Member Since:
    Jun 29, 2011
    Message Count:
    12
    Likes Received:
    0
    Occupation:
    Jobs
    Location:
    London
    Hi all,

    Hoping someone might have an answer to this.

    I am build an DataView from a DataTable where the source data is from MySQL.

    I dynamically build a selection criteria which works great except for the dates in the source table.

    I have tried the following 3 methods and get three different errors:

    ( ETD_DT <= '2011-03-17 12:11:31' ) and (ETA_DT >= '2011-03-17 12:11:31' )

    gives me an error that says
    "Cannot perform '<=' operation on MySql.Data.Types.MySqlDateTime and System.String."

    So I tried:

    ( ETD_DT <= #2011-03-17# ) and (ETA_DT >= #2011-03-17# )

    gives me an error that says
    "Cannot perform '<=' operation on MySql.Data.Types.MySqlDateTime and System.DateTime."


    So I tried:

    ( ETD_DT <= {ts '2011-03-17 12:44:03'} and ETA_DT >= {ts '2011-03-17 12:44:03'} )
    gives me an error that says
    Syntax error: Missing operand after ''2011-03-17 12:47:47'' operator

Share This Page