Have an SQL query (Command) from our database as follows:
select CUSTOMER As CUSTOMER,BILNAME As CUSTNAME,INVNUMBER As DOCNUMBER, INVDATE As DOCDATE, SHSOURCURR As SCURN, SALESPER1 As SALSPERSON1, SALESPER2 As SALSPERSON2, SALESPER3 As SALSPERSON3, SALESPER4 As SALSPERSON4, SALESPER5 As SALSPERSON5, SHIPTO As SHIPTO, INVNETNOTX As TOTALNETNOTAX, INVMISC As MISC ,ITEM As ITEMNUM, MSLDAT.dbo.OEINVD.[DESC] As Description,LINETYPE As LINETYPE, QTYSHIPPED As QTYSHIPRET, UNITPRICE, UNITWEIGHT, INVUNIT As SELLRETUNIT, UNITCONV As UNITCONV, PRIUNTCONV As PRIUNTCONV, PRICEUNIT As PRICEUNIT, INVDISCAMT As DISCOUNT, INVDISCPER As DISCPERCENTAGE from MSLDAT.dbo.OEINVH
JOIN
MSLDAT.dbo.OEINVD ON OEINVH.INVUNIQ = OEINVD.INVUNIQ
union all
select CUSTOMER As CUSTOMER,BILNAME As CUSTNAME, CRDNUMBER As DOCNUMER, CRDDATE As DOCDATE, CRSOURCURR As SCURN, SALESPER1 As SALSPERSON1, SALESPER2 As SALSPERSON2, SALESPER3 As SALSPERSON3, SALESPER4 As SALSPERSON4, SALESPER5 As SALSPERSON5, SHIPTO As SHIPTO, CRDNETNOTX As TOTALNETNOTAX, CRDMISC As MISC ,ITEM As ITEMNUM, MSLDAT.dbo.OECRDD.[DESC] As Description,LINETYPE As LINETYPE ,QTYRETURN As QTYSHIPRET, UNITPRICE,UNITWEIGHT,CRDUNIT As SELLRETUNIT, UNITCONV As UNITCONV, PRIUNTCONV As PRIUNTCONV, PRICEUNIT As PRICEUNIT, CRDDISCAMT As DISCOUNT, CRDDISCPER As DISCPERCENTAGE from MSLDAT.dbo.OECRDH
JOIN
MSLDAT.dbo.OECRDD ON OECRDH.CRDUNIQ = OECRDD.CRDUNIQ
Above union query works well until I try to add a parameter to it. The parameter being I want to pick a starting item number and ending item number from a drop down list but trying to create the parameter via the command prompt I am getting nowhere.
Any suggestions would be greatly appreciated.
Thanks in advance.
|