Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-06-14 : 21:57:03
|
| [code]SELECT CASE WHEN trx_type in('DO','CDO','DOL') then do_no, COALESCE(do_date, in_date) as in_date WHEN trx_type in('INV','CS','CN','DN','POS','INC','CNC') then in_no as do_no, in_date ENDFROM st_headWHERE (do_date>='01/01/07' and do_date<='31/12/07') or (in_date>='01/01/07' and in_date<='31/12/07') [/code]CASE WHEN condition allow multiple field?? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-14 : 22:00:57
|
Nope. Not allow. Use 2 case statement KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-06-14 : 22:01:58
|
| T.T i was thinking to shorten the query, is there anyway works like mine query except 2 case statement? |
 |
|
|
|
|
|