1

My table has an date column 'orderdate' with type as yyyy-mm-dd I want to get the date difference against getdate()

select getdate() - orderdate from table

this should return the number of days

Raj
  • 221
  • 1
  • 13

1 Answers1

2

You Need to use this:

SELECT DATEDIFF(DAY,orderdate,GETDATE()) FROM table
ADP_X
  • 333
  • 1
  • 4
  • 15