R
RW
I am trying to use a CASE statement in SQL view on a query using
SELECT
[CustomersPreviousData Table].SiteID
, RegularResults.RecNo
, RegularResults.[First Name]
, RegularResults.[Last Name]
, [CustomersPreviousData Table].Status AS [Previous Status]
, [CustomersPreviousData Table].ApplicationID AS [Previous Application]
, [CustomersPreviousData Table].StatusEffectiveDate AS [Previous Effective
Date]
, dbo_Customers.StatusEffectiveDate AS [DC Effective Date]
, CASE RegularResults.[Matching Result] WHEN "1" THEN 'Eligible' END
, dbo_Customers.RecordCode
, [CustomersPreviousData Table].StatusType
FROM RegularResults
INNER JOIN ([CustomersPreviousData Table]
INNER JOIN dbo_Customers
ON [CustomersPreviousData Table].CustomerID = dbo_Customers.CustomerID)
ON RegularResults.RecNo = [CustomersPreviousData Table].CustomerID
WHERE (((RegularResults.[Matching Result])=1));
I am trying to return the word Eligible when the Matchingresult Field has a
'1' in it. I keep getting an error
Syntax error missing operator in query expression "CASE
RegularResults.[Matching Result] WHEN "1" THEN 'Eligible' END"
The operator is 'WHEN' in SQL. Is Access looking for something else?
SELECT
[CustomersPreviousData Table].SiteID
, RegularResults.RecNo
, RegularResults.[First Name]
, RegularResults.[Last Name]
, [CustomersPreviousData Table].Status AS [Previous Status]
, [CustomersPreviousData Table].ApplicationID AS [Previous Application]
, [CustomersPreviousData Table].StatusEffectiveDate AS [Previous Effective
Date]
, dbo_Customers.StatusEffectiveDate AS [DC Effective Date]
, CASE RegularResults.[Matching Result] WHEN "1" THEN 'Eligible' END
, dbo_Customers.RecordCode
, [CustomersPreviousData Table].StatusType
FROM RegularResults
INNER JOIN ([CustomersPreviousData Table]
INNER JOIN dbo_Customers
ON [CustomersPreviousData Table].CustomerID = dbo_Customers.CustomerID)
ON RegularResults.RecNo = [CustomersPreviousData Table].CustomerID
WHERE (((RegularResults.[Matching Result])=1));
I am trying to return the word Eligible when the Matchingresult Field has a
'1' in it. I keep getting an error
Syntax error missing operator in query expression "CASE
RegularResults.[Matching Result] WHEN "1" THEN 'Eligible' END"
The operator is 'WHEN' in SQL. Is Access looking for something else?