If you are unable to create a new account, please email support@bspsoftware.com

 

UDA-SQL-0358 Line 45: Syntax error near "in" Error. Scratching my head.

Started by Universe, 03 May 2019 02:17:45 PM

Previous topic - Next topic

Universe

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"


Universe

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

MFGF

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.
Meep!

Universe