Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL syntax

19 views
Skip to first unread message

Doug Howell

unread,
Mar 28, 2013, 12:32:51 PM3/28/13
to
I have a SQL syntax question:

SELECT DISTINCT SUBSTRING(PZPPN,1,7)AS "Parent",SUBSTRING(CMDESC,2,24)AS "Description",PZSEQ AS "SeqNum",PZCPN AS "Component",(PZQTY/(10^PSDCC)) AS "Percent"
FROM AS400.S102BAFE.AADAT10.DE120M DE120M, AS400.S102BAFE.AADAT10.DE100M DE100M
WHERE PZPPN LIKE '%000/%' AND PEFOUT='0' AND PZPPN=IZPN AND PSPLNT='100'
ORDER BY Parent,SeqNum

I get the following error:

Msg 402, Level 16, State 1, Line 1
The data types int and numeric are incompatible in the '^' operator.


What am I doing wrong?


Doug

Bob Barrows

unread,
Mar 28, 2013, 2:57:17 PM3/28/13
to
Perhaps mistaking what the ^ operator does? In T-SQL ^ is. From BOL:

^ (Bitwise Exclusive OR) (Transact-SQL)
Performs a bitwise exclusive OR operation between two integer values.

I suspect you are looking for the POWER function, which:
Returns the value of the specified expression to the specified power. POWER
( float_expression , y )



0 new messages