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 |
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2008-07-07 : 11:13:04
|
| Hi I have this case statement, but I need to add in there something about the date. How do I do that? The statement that I have below works, but I just need to add in there about CLM_dout >='02-29-2008' and I am not sure how to do that. Can some one help me please?WHEN clm_att1 = 'AF' THEN CONVERT(DECIMAL(12, 2), ROUND(clm_H30 * clio_fee04 / 100.0, 2))*.65Thanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-07 : 11:16:22
|
[code]CASE WHEN clm_att1 = 'AF' AND CLM_dout >='02-29-2008'THEN CONVERT(DECIMAL(12, 2), ROUND(clm_H30 * clio_fee04 / 100.0, 2))*.65END[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-07 : 11:17:44
|
| WHEN clm_att1 = 'AF' and CLM_dout >='02-29-2008' Jim |
 |
|
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2008-07-07 : 11:28:21
|
| Thanks for your help, but I am getting a null value and I am not sure why. See the statement below.CASE WHEN clm_att1 = 'NG' AND clm_h30 = 0 THEN CONVERT(DECIMAL(12, 2), ROUND(clm_sppo * clio_fee04 / 100.0, 2)) WHEN clm_att1 = 'NG' THEN CONVERT(DECIMAL(12, 2), ROUND(clm_H30 * clio_fee04 / 100.0, 2)) WHEN clm_att1 = 'NA' THEN '0.00' WHEN clm_att1 = 'AF' AND clm_h30 = 0 THEN CONVERT(DECIMAL(12, 2), ROUND(clm_sppo * clio_fee04 / 100.0, 2)) WHEN clm_att1 = 'AF' AND clm_dout>='02-29-2008' THEN CONVERT(DECIMAL(12, 2), ROUND(clm_H30 * clio_fee04 / 100.0, 2))*.65 ELSE NULLEND AS AccessFeeFinal, |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-07 : 11:38:49
|
it means non of the case statement condition is fulfilled or any of the columns value is null KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|
|