sandy_xpac
New Member
- Joined
- Jul 13, 2016
- Messages
- 33
I am trying to run the below query in Access and I get the following error: Syntax error (missing operator) in query expression '(case when ModeCode in ('B','G') and claimpaiddate is not null then 'Paid' when ModeCode not in ('B','G') and ClaimStatus not like 'D%' and claimpaiddate is not null then 'Paid' else 'Denied' end),
select cd.PlanID as "Plan ID",
PlanName,
ApptDate,
PickupState,
PickupCounty,
ModeCode,
VendorName,
GroupID,
TripLegID,
Triplegstatus,
ClaimStatus,
(case when ModeCode in ('B','G') and claimpaiddate is not null then 'Paid'
when ModeCode not in ('B','G') and ClaimStatus not like 'D%' and claimpaiddate is not null then 'Paid' else 'Denied' end) as PaidorDenied,
ClaimPaidDate,
pp.ClientName,
pp.PlanState,
pp.Population,
pp.Status,
ServiceMonth,
ServiceYear,
Sum(TripLegs) as "Legs",
Sum(TripLegCost) as "Cost",
Sum(TripMiles) as "Miles"
from reports.dbo.Datamart_ClaimDetails cd JOIN
reports.dbo.pricing_PlanGroupings pp on cd.PlanID=pp.Plan_Code
where apptdate >= '01/01/2017'
Group by cd.PlanID,
PlanName,
ApptDate,
PickupState,
PickupCounty,
ModeCode,
VendorName,
GroupID,
TripLegID,
Triplegstatus,
ClaimStatus,
(case when ModeCode in ('B','G') and claimpaiddate is not null then 'Paid'
when ModeCode not in ('B','G') and ClaimStatus not like 'D%' and claimpaiddate is not null then 'Paid' else 'Denied' end),
ClaimPaidDate,
ServiceMonth,
ServiceYear,
pp.ClientName,
pp.PlanState,
pp.Population,
pp.Status
select cd.PlanID as "Plan ID",
PlanName,
ApptDate,
PickupState,
PickupCounty,
ModeCode,
VendorName,
GroupID,
TripLegID,
Triplegstatus,
ClaimStatus,
(case when ModeCode in ('B','G') and claimpaiddate is not null then 'Paid'
when ModeCode not in ('B','G') and ClaimStatus not like 'D%' and claimpaiddate is not null then 'Paid' else 'Denied' end) as PaidorDenied,
ClaimPaidDate,
pp.ClientName,
pp.PlanState,
pp.Population,
pp.Status,
ServiceMonth,
ServiceYear,
Sum(TripLegs) as "Legs",
Sum(TripLegCost) as "Cost",
Sum(TripMiles) as "Miles"
from reports.dbo.Datamart_ClaimDetails cd JOIN
reports.dbo.pricing_PlanGroupings pp on cd.PlanID=pp.Plan_Code
where apptdate >= '01/01/2017'
Group by cd.PlanID,
PlanName,
ApptDate,
PickupState,
PickupCounty,
ModeCode,
VendorName,
GroupID,
TripLegID,
Triplegstatus,
ClaimStatus,
(case when ModeCode in ('B','G') and claimpaiddate is not null then 'Paid'
when ModeCode not in ('B','G') and ClaimStatus not like 'D%' and claimpaiddate is not null then 'Paid' else 'Denied' end),
ClaimPaidDate,
ServiceMonth,
ServiceYear,
pp.ClientName,
pp.PlanState,
pp.Population,
pp.Status