Need help with code below. Getting Error:
Code:
IF ([Presentation].[Projects].[Salesperson] = 'PM') THEN
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote on Hold', 'Quote Open', 'Quote Completed')
OR
[Presentation].[Quotes].[Quote Status] IN ('Quote Lost', 'Quote Won', 'Quote Cancelled') AND (_add_days([Presentation].[Quotes].[Status Change Date],14)> current_date )
)
ELSE
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote Open')
)
Error:
UDA-SQL-0358 Line 45: Syntax error near "in"
No luck with the following:
CASE
WHEN
[Presentation].[Projects].[Salesperson] = 'PM'
THEN
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote on Hold', 'Quote Open', 'Quote Completed')
OR
[Presentation].[Quotes].[Quote Status] IN ('Quote Lost', 'Quote Won', 'Quote Cancelled') AND (_add_days([Presentation].[Quotes].[Status Change Date],14)> current_date )
)
ELSE
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote Open')
)
END
Quote from: Universe on 03 May 2019 02:30:40 PM
No luck with the following:
CASE
WHEN
[Presentation].[Projects].[Salesperson] = 'PM'
THEN
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote on Hold', 'Quote Open', 'Quote Completed')
OR
[Presentation].[Quotes].[Quote Status] IN ('Quote Lost', 'Quote Won', 'Quote Cancelled') AND (_add_days([Presentation].[Quotes].[Status Change Date],14)> current_date )
)
ELSE
(
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote Open')
)
END
From the context of the expression, I'm guessing this syntax is in a filter? My best advice is to code your filter as a boolean, eg
([Presentation].[Projects].[Salesperson] = 'PM' AND ([Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote on Hold', 'Quote Open', 'Quote Completed') OR [Presentation].[Quotes].[Quote Status] IN ('Quote Lost', 'Quote Won', 'Quote Cancelled') AND (_add_days([Presentation].[Quotes].[Status Change Date],14)> current_date )))
OR
[Presentation].[Quotes].[Quote Status] IN ('Prospect', 'Quote Open')
Cheers!
MF.
Thank you MF. No errors. :) :)