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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Operand should contain 1 column

Author  Topic 

fengfeng
Yak Posting Veteran

64 Posts

Posted - 2011-05-02 : 12:20:39



I get that error when I try to execute this query. Its a way to project the sales percentage. So i take the existing sales + the remaining volumn * the sales % of the last 3 days to get a project amount of sales then I divide that by the volumn of the entire campaign.



SUM(gaa.sales)

+

(((IFNULL((brand.budget/(brand.unit_price/1000)),brand.bonus_units))
- SUM(gaa.column),0 )


*

(SUM(
CASE
WHEN gaa.date >= DATE_SUB(CURRENT_DATE, INTERVAL 4 DAY) THEN gaa.sales
END
)
/

SUM(
CASE
WHEN gaa.date >= DATE_SUB(CURRENT_DATE, INTERVAL 4 DAY) THEN gaa.impression
END
) ))


/

(IFNULL((brand.budget/(brand.unit_price/1000)),brand.bonus_units)) as 'projected'

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-02 : 12:54:40
That isn't T-SQL.
This is a MS SQL Server forum.
I don't know what you are using, sorry but please try it in a forum that is about your used language/server to get better advice.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -