Re: Record Count Question
From: Jacco Schalkwijk (jacco.please.reply_at_to.newsgroups.mvps.org.invalid)
Date: 01/20/05
- Next message: Jacco Schalkwijk: "Re: Record Count Question"
- Previous message: Louis Davidson: "Re: Beware: Timestamps are not contained inside Transactions!!"
- In reply to: Yoyo: "Record Count Question"
- Next in thread: Jacco Schalkwijk: "Re: Record Count Question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 Jan 2005 22:48:01 -0000
Something like:
SELECT
SUM(CASE WHEN YEAR(M200B) = 2005 THEN 1 ELSE 0 END AS M200B,
SUM(CASE WHEN YEAR(M200B) = 2005 THEN 1 ELSE 0 END AS M200B,
SUM(CASE WHEN YEAR(M200B) = 2005 THEN 1 ELSE 0 END AS M200B,
SUM(CASE WHEN YEAR(M200B) = 2005 THEN 1 ELSE 0 END AS M200B,
SUM(CASE WHEN YEAR(M200B) = 2005 THEN 1 ELSE 0 END AS M200B,
-- Jacco Schalkwijk SQL Server MVP "Yoyo" <ryoh@dot.ca.gov> wrote in message news:eMMgm0z$EHA.3256@TK2MSFTNGP11.phx.gbl... > Hi all, > > I have a table that looks like the table below. I would like to count > each > of the column where the dates fall within this calendar year. I would > like > to produce an end result that shows counts of each column that fits the > criteria. Can someone please help me accomplish this? Thank you very > much! > > Roger > > > M200B M380B M410B M460B M500B M600B > 05/04/04 02/04/05 03/01/05 04/20/05 09/16/05 01/31/07 > 08/06/97 07/06/04 07/06/04 07/20/04 08/31/04 08/05/05 > 05/28/04 03/21/05 04/18/05 05/16/05 09/12/05 07/17/06 > 02/24/05 02/08/08 01/08/08 04/10/08 08/01/08 04/14/10 > 09/29/00 05/10/02 04/29/02 06/28/02 10/17/02 02/01/05 > 06/29/01 11/10/04 11/15/04 12/15/04 03/15/05 12/02/05 > 08/16/99 02/17/05 02/17/05 05/13/05 12/20/05 11/12/08 > 03/11/04 03/02/05 03/18/05 03/30/05 10/06/05 09/26/06 > 10/01/99 12/01/04 02/15/05 02/15/05 08/22/05 08/24/06 > 12/29/00 05/10/02 06/25/02 06/29/02 11/27/02 03/30/05 > 03/28/02 05/11/02 05/22/02 06/27/02 10/17/02 08/31/04 > 10/01/02 09/16/04 11/15/04 12/30/04 05/26/05 05/16/06 > 06/24/02 01/27/05 04/11/05 04/12/05 08/04/05 08/03/09 > 11/14/02 09/28/04 10/29/04 11/10/04 04/26/05 04/24/09 > 09/03/99 03/26/02 03/07/02 04/23/02 02/04/03 03/01/05 > 03/30/01 03/13/02 04/25/02 05/24/02 11/06/02 04/29/05 > 09/01/98 04/08/05 05/13/05 05/27/05 10/13/05 09/01/06 > 05/28/04 03/10/05 04/18/05 05/16/05 09/22/05 10/16/06 > 07/25/02 10/15/04 01/05/05 01/31/05 05/19/05 01/27/06 > 10/16/97 04/04/05 07/05/05 06/06/05 12/21/05 07/31/08 > 03/30/01 03/13/02 04/02/02 05/02/02 10/01/02 08/13/04 > 06/01/04 02/15/05 02/23/05 04/28/05 08/15/05 10/24/06 > 05/20/05 04/26/06 06/22/06 07/07/06 08/18/06 06/12/07 > 12/28/98 01/14/00 01/01/96 03/09/00 06/30/00 09/10/04 > 06/13/02 08/04/03 06/14/04 08/06/04 12/22/04 10/24/05 > 10/13/99 09/30/04 03/05/04 12/30/04 08/26/05 07/31/07 > 06/29/01 11/12/04 11/16/04 12/16/04 03/17/05 04/19/06 > 05/20/04 02/04/05 03/01/05 04/20/05 09/16/05 09/11/07 > 03/15/00 01/13/05 01/13/05 04/01/05 06/13/05 02/14/07 > 10/11/97 05/29/03 05/01/03 06/30/03 10/07/03 12/30/04 > 04/25/01 07/22/04 07/22/04 10/18/04 05/06/05 04/26/06 > >
- Next message: Jacco Schalkwijk: "Re: Record Count Question"
- Previous message: Louis Davidson: "Re: Beware: Timestamps are not contained inside Transactions!!"
- In reply to: Yoyo: "Record Count Question"
- Next in thread: Jacco Schalkwijk: "Re: Record Count Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|