Re: Need Help in QUERY
From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 02/15/04
- Next message: Anith Sen: "Re: How to connect programatically to another server?"
- Previous message: Thanks: "Nested Stored Procedures - Transaction Problem"
- In reply to: Prabhat: "Re: Need Help in QUERY"
- Next in thread: Prabhat: "Re: Need Help in QUERY"
- Reply: Prabhat: "Re: Need Help in QUERY"
- Reply: Prabhat: "Re: Need Help in QUERY"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 14 Feb 2004 23:47:52 -0600
Do:
SELECT MAX(CASE YEAR(collection_dt) WHEN 2003
THEN YEAR(collection_dt) END),
MAX(CASE YEAR(collection_dt) WHEN 2003
THEN MONTH(collection_dt) END),
SUM(CASE YEAR(collection_dt) WHEN 2003
THEN Amount END),
MAX(CASE YEAR(collection_dt) WHEN 2002
THEN YEAR(collection_dt) END),
MAX(CASE YEAR(collection_dt) WHEN 2002
THEN MONTH(collection_dt) END),
SUM(CASE YEAR(collection_dt) WHEN 2002
THEN Amount END)
FROM tbl
GROUP BY MONTH(collection_dt) ;
-- - Anith ( Please reply to newsgroups only )
- Next message: Anith Sen: "Re: How to connect programatically to another server?"
- Previous message: Thanks: "Nested Stored Procedures - Transaction Problem"
- In reply to: Prabhat: "Re: Need Help in QUERY"
- Next in thread: Prabhat: "Re: Need Help in QUERY"
- Reply: Prabhat: "Re: Need Help in QUERY"
- Reply: Prabhat: "Re: Need Help in QUERY"
- Messages sorted by: [ date ] [ thread ]
Loading