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
 An expression of non-boolean type specified in a c

Author  Topic 

hspatil31
Posting Yak Master

182 Posts

Posted - 2009-09-01 : 07:21:49
Dear All,

I tried following queary but it is giveing following error,

Error:

An expression of non-boolean type specified in a context where a condition is expected, near 'x'.

Queary:

UPDATE T_BANK_IMPORT_BI
SET FLEXI_2 = 'M' where
(SELECT sum(cast(Amount as decimal(18,2))) as CHANN_AMOUNT,PK_CH_SCHEME_ID FROM T_CD_IMPORT
WHERE TRADE_DATE = '4/13/2009' AND cast(AMOUNT as decimal(18,2)) <>0 and flexi_2 IS NULL
group by PK_CH_SCHEME_ID

intersect

SELECT sum(cast(CREDITS as decimal(18,2))) as BANK_CREDIT,PK_SCHEME_ID FROM T_BANK_IMPORT_BI
WHERE DATE = '4/13/2009' AND cast(CREDITS as decimal(18,2)) <>0 and flexi_2 IS NULL
group by PK_SCHEME_ID) x

thnks
harish

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2009-09-01 : 07:25:07
Not sure what you want to achive. Could you please elaborate on that?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

ra.shinde
Posting Yak Master

103 Posts

Posted - 2009-09-01 : 08:04:38
UPDATE T_BANK_IMPORT_BI
SET FLEXI_2 = 'M' where
EXISTS(SELECT sum(cast(Amount as decimal(18,2))) as CHANN_AMOUNT,PK_CH_SCHEME_ID FROM T_CD_IMPORT
WHERE TRADE_DATE = '4/13/2009' AND cast(AMOUNT as decimal(18,2)) <>0 and flexi_2 IS NULL
group by PK_CH_SCHEME_ID

intersect

SELECT sum(cast(CREDITS as decimal(18,2))) as BANK_CREDIT,PK_SCHEME_ID FROM T_BANK_IMPORT_BI
WHERE DATE = '4/13/2009' AND cast(CREDITS as decimal(18,2)) <>0 and flexi_2 IS NULL
group by PK_SCHEME_ID)

Rahul Shinde
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 06:09:01
isnt this similar to

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=132117
Go to Top of Page
   

- Advertisement -