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')
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')