serverstorm — 2011-11-05T11:34:23-04:00 — #1
Hi is there some way that output can have different aliases for the THEN or ELSE of the CASE?
CASE WHEN prg.program_name LIKE '%Family Emergency%'
THEN l2prg.registration_number<font color='#0000cd'> as </font><font color='#0000CD'>'Registrant Number</font>'
ELSE l2prg.registration_number<font color='#0000cd'> as 'P</font><font color='#0000CD'>rogram Number' </font>
This does not work and I have tried various bracketing that did not work. It is not a huge deal if this can't be done because it easy enough to do this programatically but it would be nice to know if there is some way to do this?
r937 — 2011-11-05T13:27:55-04:00 — #2
you're on the right track but barking up the wrong tree
offtopic: anyone familiar with the classic book "Go Dog Go"?
what you want is something like this --
, CASE WHEN prg.program_name LIKE '%Family Emergency%'
THEN 'Registrant Number'
ELSE 'Program Number'
END AS number_type
although in my experience a yellow flag should go up whenever the same column sometimes means one thing and sometimes another
serverstorm — 2011-11-05T13:49:58-04:00 — #3
That is a fantastic book that my kids loved when they were little!
Yes that divergent thinking thing coming into play again. Thank you.
The customer for this application has a primary program that they want to display and input in separate fields than the other programs they have; although All these programs have a unique registrant number, program name and registration date.
If I was to break this into separate tables then I would have a complete duplicate structure to the programs table. Does it make sense to break these apart or does this way of doing things - in this case - make sense?
r937 — 2011-11-05T15:51:13-04:00 — #4
no, i do not like that hat
serverstorm — 2011-11-05T16:22:07-04:00 — #5
Ok, already rolled ahead keeping as is...
off topic: you have quite the plethora of classic book quotes because the 'no, i do not like that hat' is CAT in the HAT...NICE :)
r937 — 2011-11-05T16:33:33-04:00 — #6
just thought you should know which book i was quoting
now we can meander off into the sunset at last...