Hello, SQL2008R2
My database has a column of type SmallDateTime but no time value is ever stored. ('2011-04-19 00:00:00')
If I have criteria that uses
My question is it better to have
or is there a better way?
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
My database has a column of type SmallDateTime but no time value is ever stored. ('2011-04-19 00:00:00')
If I have criteria that uses
Code:
--Yes I know this is incorrect, that is why I am asking the question
WHERE myColumnDate = DATEADD(day, -10, GETDATE())
Code:
WHERE myColumnDate = CAST(DATEADD(day, -10, GETDATE()) AS DATE)
--or
WHERE myColumnDate = DATEADD(dd, DATEDIFF(dd, 0, DATEADD(day, -10, GETDATE())), 0)
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!