Microsoft
Software
Hardware
Network
Question : CASE....WHEN USING A DATE COMPARISON
I would like to create a column in an SQL Server query that produces a text result based on the comparions of a date in another field. My query looks like this :
SELECT ACCOUNT_ID, ACCOUNT_YEAR, FILED_DATE,
(CASE FILED_DATE
WHEN >= CDATE(12/31/2100) THEN 'KEYED'
WHEN < CDATE(12/31/2000) THEN 'WEB'
END) AS AUDIT_STATUS
FROM ppAuditPartIa
And of course it doesn't work..syntax error near '>'
Answer : CASE....WHEN USING A DATE COMPARISON
SELECT ACCOUNT_ID, ACCOUNT_YEAR, FILED_DATE,
(CASE
WHEN FILED_DATE >= '12/31/2100' THEN 'KEYED'
WHEN FILED_DATE < '12/31/2000' THEN 'WEB'
END) AS AUDIT_STATUS
FROM ppAuditPartIa
Random Solutions
Sed in a while read loop wont replace pattern stored in a variable
2003 server preparing network connections
Scroll Bar on Dynamic Text Box
How do I change the default website in IIS to point to a Sharepoint subsite?
RPC over HTTP - "Outllook Anywhere" not connecting to server
AS3: moving object to and from specific location
error when running norton ghost 14 backup
how to renew or reissue cert on exchange server for owa and rpc over http
Sharing printer drives to 32-bit XP with a 64-bit Windows 2003 R2 Server
Viewing TCP / UDP Ports for Spam Firewall Config