SQLTeam.com | Weblogs | Forums

Convert NVARCHAR to date format to use with Get Date

Good afternoon, I'm fairly new to date formats in SQL and could do with a little guidance on how to change the format from an nvarchar field with a date format of DD/MM/YYY to something I can use GetDate() with.

For example,

select * from tablename
where Date_of_Last_Attempt >= Getdate()-7

Thanks in advance.

Dates should really be held as dates but if you really have to cope with strings:

hi

please see the below link

it will have examples