-5

I have a field named duedate and data type is string. I want to compare that field with current date. I used below code:

select itemid from issue where CONVERT(datetime, duedate, 105) < '20/11/2016'

i got error like "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value."

please help me out.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
AKB
  • 11
  • 4

1 Answers1

0

use this:

select itemid from issue where CONVERT(nvarchar(12), duedate, 105) < '20/11/2016'
Bishoy Ezzat
  • 159
  • 1
  • 3
  • 16