Re: Counting yes values only in query
From: Katt (anonymous_at_discussions.microsoft.com)
Date: 06/21/04
- Next message: Kelly: "Re: Parameter query from mulitiple fields"
- Previous message: DEI: "Crosstab - Make table"
- In reply to: John Spencer (MVP): "Re: Counting yes values only in query"
- Next in thread: John Spencer (MVP): "Re: Counting yes values only in query"
- Reply: John Spencer (MVP): "Re: Counting yes values only in query"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Jun 2004 10:17:49 -0700
Sorry to be a pain about this but I get an error message
from this statement. I am prompted to enter a query
restriction. Yes, Y, and True elicit no responses.
Is there a way to do this from design view instead of in
the SQL writing mode? Sorry to be picky but I need a
query to disregard any NO statements.
-Katt
>-----Original Message-----
>Pardon me for jumping in.
>
>REVISED QUERY: This assumes that when you are counting
you want to count "yes"
>values in the field AND that the field is a Yes/No type
(boolean) field. I've
>also aliased the table name as I to make it easier to
type the revision
>
>
>SELECT Format([I].[Date of decision/interview],'mmmm
yyyy')
>AS [Date of decision/interview By Month],
>[I].[Form type],
>Abs(Sum([I].[Initial Interview])) AS [CountOfInitial
Interview],
>Abs(Sum([I].[Initial Interview No Show])) AS
[CountOfInitial Interview No Show],
>Abs(Sum([I].[No Show Rescheduled]) )AS [CountOfNo Show
Rescheduled],
>Abs(Sum([I].Approve)) AS CountOfApprove,
>Abs(Sum([I].[Deny - Other]) )AS [CountOfDeny - Other],
>Abs(Sum([I].[Deny - Fraud])) AS [CountOfDeny - Fraud],
>Abs(Sum([I].[Continued?]) )AS [CountOfContinued?],
>Abs(Sum([Initial entry].[Continued Grant]) )AS
[CountOfContinued Grant],
>Abs(Sum([I].[Continued Deny - Other])) AS
[CountOfContinued Deny - Other],
>Abs(Sum([I].[Continued Deny - Fraud])) AS
[CountOfContinued Deny - Fraud]
>FROM [Initial entry] As I
>GROUP BY Format([I].[Date of decision/interview],'mmmm
yyyy'),
> [I].[Form type],
> Year([I].[Date of decision/interview]) *12+
> DatePart('m',[I].[Date of decision/interview])-1
>ORDER BY Format([I].[Date of decision/interview],'mmmm
yyyy'),
> [I].[Form type];
>.
>
- Next message: Kelly: "Re: Parameter query from mulitiple fields"
- Previous message: DEI: "Crosstab - Make table"
- In reply to: John Spencer (MVP): "Re: Counting yes values only in query"
- Next in thread: John Spencer (MVP): "Re: Counting yes values only in query"
- Reply: John Spencer (MVP): "Re: Counting yes values only in query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|