Click here to Skip to main content
15,888,401 members

Comments by Dennys Henry (Top 1 by date)

Dennys Henry 27-Oct-15 3:11am View    
Sorry about that. If it's a datetime field, you have to first cast it to a date (which might be a lot of work), it works just fine for me since most of the fields am working on are just date fields and not datetime.

However if you test SELECT SUBSTRING(CAST(CAST(GETDATE() AS DATE)AS NVARCHAR),1,7) you get '2015-09' / '2015-10' etc