January 4, 2016 at 3:09 pm
Curious, is there a way to set up a hierarchy in SQL. Here's what I'm looking to do.
If an OCC code = 08 then NCP.Expected
But, if the person doesn't have an OCC code of 08 but instead has a 0...I'd then what the NCP.Expected.
So, I'd want it to check for 08 first and give the Expected field and if they don't have an 08 check for 0 and give the Expected field.
January 4, 2016 at 3:14 pm
Like this? Your question is somewhat confusing and incomplete.
CASE
WHEN OOC_Code = '08' THEN SomeValue
WHEN OOC_Code = '0' THEN SomeValue
ELSE DefaultValue
END
January 4, 2016 at 3:26 pm
That's what I figured....but on one of my records it's still showing the Expected for the 0 OCC code...hmmmm
January 4, 2016 at 3:32 pm
Post your SQL statement here, preferably with a sample of the data you have been using.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply