I am beginner in MSSQL.
After writing:
Expand|Select|Wrap|Line Numbers
- SELECT
- DISTINCT UpDate AS ExpirationDate
- FROM MyTable
ExpirationDate
------------------------------
1 NULL
2 2007-11-05 12:53:12.000
3 2003-01-14 13:33:12.000
4 2004-01-15 12:34:23.000
But I would like to obtain:
ExpirationDate
-----------------------------
1 ALIVE
2 DEAD
3 ANY
Namely, I would like to check ISNULL. If there is any record with value NULL then I cast it to string "ALIVE".
When there is 1 or more dates I would obtain only 1 record with casted to string "DEAD"
Additionally DB should answer always with record "ANY".
I thougth with Casting all the dates to BIT if they are NULL or not and then select Distinct values from 0s and 1s.
Could You help me? Thank You in advance.
Paul