locked
Compare Date Field Stored as Varchar(300) in Database to the parameter that I am passing as Date/Time Field RRS feed

  • Question

  • I need to immediately solve a problem where I am trying to compare the  Date Field values Stored as Varchar(300) in Database to the parameter  that I am passing as Date/Time Field .No matter how ever I convert and compare it fails.The values stores are like  below in the database but it is stored in Varchar(300) field:

    2013-07-01 00:00:00
    2013-07-01 00:00:00
    2013-07-01 00:00:00
    2013-08-05 00:00:00
    2013-07-01 00:00:00 

    Wednesday, July 10, 2013 3:23 PM

Answers

  • CONVERT(datetime, varcharfield, 120)

    • Proposed as answer by Sofiya Li Thursday, July 18, 2013 9:14 AM
    • Marked as answer by Sofiya Li Tuesday, July 23, 2013 5:34 AM
    Wednesday, July 10, 2013 3:47 PM