Good morning all,I need just a little guidance...I have math query that I need to do where a certain portion below 2100 is one price and anything above that number will be billed with another price.Amt <= 2100 then .55Amt > 2100 then 1.25Ex: 3000 so 2100 would be billed @.55 and the remaining 900 @ 1.25So looking at the table code below...how would I get the "over" amount for line 3.Create Table #tmpAllosource(Donor# varchar(10),Rules varchar(50),Amt int,Unit varchar(6),Status varchar(11))Insert Into #tmpAllosource Values ('1','Reject - Pos Sero',4500,'sq cm','Reject')Insert Into #tmpAllosource Values ('2','Under 2100 Over 900 sq cm',1752,'sq cm','Full Bill')Insert Into #tmpAllosource Values ('3','Under 2100 ',3542,'sq cm','Full Bill')Insert Into #tmpAllosource Values ('4','At 2100 ',2100,'sq cm','Full Bill')Insert Into #tmpAllosource Values ('5','900 sq cm',775,'sq cm','Full Bill')Select a.*, Case When (a.Amt<=2100 AND a.Amt>899 ANd a.Status <> 'Reject') Then a.Amt*.55 When (a.Amt>2100 ANd a.Status <> 'Reject') Then 2100*.55 Else 0 end as 'Under 2100 @.55/sqcm', '' as 'Over 2100 @1.25/sqcm', Case When (a.Status = 'Reject' OR a.Amt<900) Then 500 When a.Amt<=2100 AND a.Amt>899 Then a.Amt*.55 Else 0 end as TotalFrom #tmpAllosource a--Drop table #tmpAllosource
any help would be greatly appreciated.Larry Everyday life brings me back to reality