SyntaxTerror
Technical User
ntaxTerror (TechnicalUser) Jan 6, 2011
I have a CASE statement where I'm using MAX in my WHEN and it's failing the conditions of the WHEN because the date doesn't fall within the specified range, when it should.
Looking at the date output, it pulls a date of 2007-01-09 when it should pull something like 2011-01-03. Why isn't it pulling the max date?:
SELECT CASE WHEN max(table.CreatedDate) between '2010-12-28' AND '2011-01-06' THEN blahblah ELSE 'You fail.'
It keeps outputting 'You Fail' because it's pulling the 2007 date. What do I need to do to get it to recognize the actual max date?
Thanks!
I have a CASE statement where I'm using MAX in my WHEN and it's failing the conditions of the WHEN because the date doesn't fall within the specified range, when it should.
Looking at the date output, it pulls a date of 2007-01-09 when it should pull something like 2011-01-03. Why isn't it pulling the max date?:
SELECT CASE WHEN max(table.CreatedDate) between '2010-12-28' AND '2011-01-06' THEN blahblah ELSE 'You fail.'
It keeps outputting 'You Fail' because it's pulling the 2007 date. What do I need to do to get it to recognize the actual max date?
Thanks!