Anyone know the best way to join and display a description instead of a value in the CheckHed.Checksrc field?
Was looking for a source table to join to but could not find one. Maybe there is a document that shows translate values I could reference and related records?
Not sure if it’s “best way” but I personally would add a calculated field along these lines:
when CheckHed.Checksrc = 1 then “AP Disbursements”
when CheckHed.Checksrc = 2 then “AP Manual”
when CheckHed.Checksrc = 3 then “AP User”
when CheckHed.Checksrc = 4 then “PR Manual”
when CheckHed.Checksrc = 4 then “PR User”
You could even name them anything that makes more sense to you and your users.
Thank you - Thats a great idea!
Any idea why I may get this error in the syntax? I haven’t used the case statement before
Your help is appreciated!
The error is because the text you copied has “Fancy Quotes” instead of
@lgraham should have used the formatting commands, making her post:
when CheckHed.Checksrc = 1 then "AP Disbursements"
when CheckHed.Checksrc = 2 then "AP Manual"
when CheckHed.Checksrc = 3 then "AP User"
when CheckHed.Checksrc = 4 then "PR Manual"
when CheckHed.Checksrc = 4 then "PR User"
Thanks for helping Calvin
I seem to be getting that same error no matter what quotes I use. also tried single quotes. Any other thoughts?
What is the name of your calc field, and the type?
Those need to be single quotes around the strings, like:
when CheckHed.Checksrc = 1 then 'AP Disbursements'
when CheckHed.Checksrc = 2 then 'AP Manual'
when CheckHed.Checksrc = 3 then 'AP User'
when CheckHed.Checksrc = 4 then 'PR Manual'
when CheckHed.Checksrc = 4 then 'PR User'
It definitely would be the single quote
Try removing the () around the case statement. It isn’t needed.
Also, what data type is your calculated field? If it’s NVARCHAR, then the else may need to be
I’d leave those outer parenthesis.
Thanks - that seems to have done the trick:
Hey @littlesistersba - I noticed the Case statement doesn’t actually give you the descriptors from the data dictionary.
Case 4 is in there twice (no
- Nothing for
Case 4 should be,
Case 5 should be,
Case 6 should be,
good catch -Thanks again Calvin
when 1 then 'AP Disbursements'
when 2 then 'AP Manual'
when 3 then 'AP User'
when 4 then 'PR'
when 5 then 'PR Manual'
when 6 then 'PR User'