Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parm using open query

Status
Not open for further replies.

snufse1

Programmer
Nov 14, 2008
66
US
Coming from a sequel server box and using linked server, does anyone know ho to pass a parm using open query?



declare @Terminal char(1)
set @Terminal = 'H'
SELECT *
FROM OPENQUERY(AS400SRV_MSDASQL, 'select date(digits(decimal(rcdgj + 1900000,7,0))) as transdate,
rcodoc as ticketno,
rctank as tankid,
rcpex1 as petroex,
sum(decimal(rcqty * .01, 31, 2)) as gross,
sum(decimal(rcnetg * .01, 31, 2)) as net
from VGITFRLIB.F551202A
where rcodoc <> '' '' and
rcdl01 <> ''MANUAL RECEIPT'' and
rcpltc = ' + @Terminal + '
group by date(digits(decimal(rcdgj + 1900000,7,0))),
rcodoc,
rctank,
rcpex1')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top