Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab 1

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,967
US
Haven't worked with Access much but I basically want to count two fields and have the # of instances print beside them. This is probably easy but I am having trouble. Basically I have two fields in a table named 11-10-05 Respones and the fields are called STORE CODE and LIST CODE. I want a report that looks like the following:

Store Code List Code Quantity
CS IN1 1
GB BH4 8

Right now my query looks like this:

TRANSFORM Count([11-10-05 Respones].[STORE CODE]) AS CountOfStoreCode
SELECT [11-10-05 Respones].[STORE CODE], [11-10-05 Respones].[LIST CODE]
FROM [11-10-05 Respones]
GROUP BY [11-10-05 Respones].[STORE CODE], [11-10-05 Respones].[LIST CODE]
PIVOT [11-10-05 Respones].[LIST CODE];

Any help would be appreciated. Thanks.

Swi
 
Why not simply this ?
SELECT [STORE CODE], [LIST CODE], Count(*) AS Quantity
FROM [11-10-05 Respones]
GROUP BY [STORE CODE], [LIST CODE]


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You are correct. Didn't even think of it. Thanks.

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top