Expand|Select|Wrap|Line Numbers
- :
- AnnualRP = sum(CASE WHEN Original.CampCode like '%u%'
- AND(Original.CompletedCode = 24 OR Original.CompletedCode = 25)
- THEN cast((adprem)*12 as money)
- WHEN Original.CampCode like '%u%'
- AND(Original.CompletedCode <> 25 AND Original.CompletedCode <> 24) THEN 0
- ELSE cast((Price)*12 as money) END)
- + (Select cast(sum(annualrp) as money) as annualrp from tbl_obmi_manualsales where date = original.calldate and campcode = original.campcode and democode = original.democode) ....
To me this seems logical, however, every row has 'null' in the resultant dataset.
I have also tried joining the table on and adding onto the end "+ ManualSales.annualRP", but this still returns no records.
Am I unaware of some addition rule here or some other rule?
The query works and gives figures when the addition is taken off, it's just when it's tacked onto the end it gives null values.
Any ideas or pointers please?!
Thanks
J