Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select *
- from tableA
- inner join tableB on tableA.id = tableB.aid
- and cast(a.date AS DATETIME) = CAST('2015-08-24' AS DATETIME)
- select *
- from tableA
- inner join tableB on tableA.id = tableB.aid
- and cast(a.date AS DATETIME2(3)) = CAST('2015-08-24' AS DATETIME2(3))
- Select * from tableA inner join tableB
- on tableA.id = tableB.aid
- and ISDATE(tableA.date)
- and cast(tableA.date AS DATETIME) = CAST('2015-08-24' AS DATETIME)
- Select * from tableA inner join tableB
- on tableA.id = tableB.aid
- and cast(a.date AS DATETIME) = CAST('20150824' AS DATETIME)
- Select * from tableA inner join tableB
- on tableA.id = tableB.aid
- and case when substring(a.date, 1, 2) not in ('19', '20') then null else CAST(a.date AS DATETIME) end = CAST('20150824' AS DATETIME)
Add Comment
Please, Sign In to add comment