Hey Everyone,
This one has me quite confused.
I have 2 snippets of code which I would expect to return the same results but they are not.
Snippet 1 returns the full range of transaction dates but snippet 2 returns nothing, not a single result.
Does anyone have any thoughts on what may be causing this?
/Nice
I feel sorry for people who don't drink, when they wake up in the morning that's as good as the're going to feel all day!
This one has me quite confused.
I have 2 snippets of code which I would expect to return the same results but they are not.
Snippet 1 returns the full range of transaction dates but snippet 2 returns nothing, not a single result.
Code:
--Snippet 1
SELECT TransactionDate
,CONVERT(varchar(10), TransactionDate, 103)
,CONVERT(varchar(10), TransactionDate, 102)
FROM dbo.Transactions
WHERE CONVERT(varchar(10), TransactionDate, 102) >= '2011.09.30'
AND CONVERT(varchar(10), TransactionDate, 102) <= '2011.10.03'
--Snippet 2
SELECT TransactionDate
,CONVERT(varchar(10), TransactionDate, 103)
,CONVERT(varchar(10), TransactionDate, 102)
FROM dbo.Transactions
WHERE CONVERT(varchar(10), TransactionDate, 103) >= '30/09/2011'
AND CONVERT(varchar(10), TransactionDate, 103) <= '03/10/2011'
Does anyone have any thoughts on what may be causing this?
/Nice
I feel sorry for people who don't drink, when they wake up in the morning that's as good as the're going to feel all day!