0

I'm trying to get the latest date from a csv file , the dates are stored in this form

NOV 14 2010
FEB 1 2012
JUN 18 2014

and my query is like

SELECT Max(date) from table

I'm getting

NOV 14 2010

any idea ?

Ateeq
  • 797
  • 2
  • 9
  • 27

1 Answers1

0

They are likely being considered strings(varchar) not DateTimes. Try:

SELECT MAX(CAST(TABLE.date as DateTime)) FROM TABLE
Jeffrey Wieder
  • 2,336
  • 1
  • 14
  • 12