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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria

Status
Not open for further replies.

pungigi

Programmer
Oct 29, 2003
115
US
I have a table with 52 Trip Status' I want a query that pulls anything that begins with a D, It keeps telling me it is too complex, can anyone help??
 
Hi,

Please post your SQL.

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
SELECT Lisa.[Appt Date], Lisa.[Plan Id], Lisa.[Trip Status], Count(Lisa.[Trip Status]) AS [CountOfTrip Status]
FROM Lisa
GROUP BY Lisa.[Appt Date], Lisa.[Plan Id], Lisa.[Trip Status]
HAVING (((Lisa.[Appt Date]) Between [Begin Date] And [End Date]) AND ((Lisa.[Plan Id])=[Enter Plan Id]) AND ((Count(Lisa.[Trip Status]))="begins with D"));
 
Try this:
SELECT Lisa.[Appt Date], Lisa.[Plan Id], Lisa.[Trip Status], Count(Lisa.[Trip Status]) AS [CountOfTrip Status]
FROM Lisa
WHERE [Appt Date] Between [Begin Date] And [End Date]
AND [Plan Id]=[Enter Plan Id]
AND [Trip Status] Like 'D*'
GROUP BY Lisa.[Appt Date], Lisa.[Plan Id], Lisa.[Trip Status]
;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 


How can a COUNT, be a string?


Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top