E9: Calculated BAQ fields (Case IF Statement errors)

Hi all,

It’s been a little while since being in the Epicor 9 world… so it could very much be user error! :see_no_evil_monkey:

I’m running into a syntax/conversion error trying to create a BAQ calculated field and I can’t seem to resolve it.

For the purpose of trying all options… I’ve moved away from the BAQ I’m trying to amend, and just created a basic one that looks at the customer table. The goal is to essentially create a ‘Sort’ field. In this example, I’d want TESTCUSTOMER to be shown first so I’m assigning it 1 but I keep getting the below error. Same thing happens if I assign it an ‘A’. Am I missing something please?

Thanks

Are they using Progress database or SQL database? I think in Progress its " not ' for strings, cant remember.

2 Likes

Its SQL database. Ah that’s a good shout, I’ve tried both versions but still same error :frowning:

What if you put () around Customer.Name = ‘TEST CUSTOMER’

(Customer.Name = ‘TEST CUSTOMER’)

Is ‘case when’ showing black text as it is usually blue? Have you tried deleting and re-adding the field?

1 Like

upvote this. It’s not recognizing CASE WHEN as a keyword. Re-add the field, or comment it out and just type CASE WHEN THEN ELSE END with nothing in it to make sure they all turn blue. If you copied and pasted that from another editor there might be a hidden character that’s buggering it up.

1 Like

Thank you for raising this! I see what you mean, I deleted the field, even started a new query and wrote it out. It’s only recognising the THEN ELSE END

Try renaming your calculated field name using an under score. The Dash is not supported at least in 10.2

What happens if you don’t type it and instead double click from the Functions menu?

Thanks alot!!:smiley: This worked, needed to be an If!