What wrong with my query

samia

Registered User.
Local time
Tomorrow, 02:51
Joined
Feb 19, 2004
Messages
51
Hi Guys,

what could be the probelm with my query? Here:
******************
SELECT tblPartnerProfile.PartnerType AS [Org Type], tblPartnerProfile.PartnerName, tblPartnerProfile.PartnerLoc1, tblPartnerProfile.PartnerStatus AS Status, Count(PartnerType) AS TotalType,
FROM tblPartnerProfile
WHERE PartnerLoc1 = 1 OR PartnerLoc1 = 2
******************************
I would like to have it give a count of how many [Org Type] 1 and 2 for Loc1 1 and Loc2 2.

Thanks in advance,

Samia
 
Last edited:
I think this comma might cause an error message.
Code:
TotalType,
 
I think this comma might cause an error message.
Code:
TotalType,

Thanks Alc, but ihas still failed.
 
What is the erro message?

Also, apologies but I missed the part about the grouping and concentrated totally on the syntax. The following may work:
Code:
SELECT 
tblPartnerProfile.PartnerType AS [Org Type],                   
tblPartnerProfile.PartnerName, 
tblPartnerProfile.PartnerLoc1, 
tblPartnerProfile.PartnerStatus AS Status, 
Count(PartnerType) AS TotalType,
FROM 
tblPartnerProfile
WHERE 
(PartnerLoc1 = 1) OR (PartnerLoc1 = 2)
GROUP BY 
tblPartnerProfile.PartnerType,
tblPartnerProfile.PartnerName, 
tblPartnerProfile.PartnerLoc1, 
tblPartnerProfile.PartnerStatus;
 
Last edited:
Alc,

The error is 'the SELECT statment includes a reserved word or an argument name that is mispelled or missing, or the punctuation is incorrect.'

Thanks,

Samia
 

Users who are viewing this thread

Back
Top Bottom