Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter Based on Query Post Reply Post New Topic
Author Message
jsh8286
Groupie
Groupie
Avatar

Joined: 09 Mar 2012
Online Status: Offline
Posts: 46
Quote jsh8286 Replybullet Topic: Parameter Based on Query
    Posted: 04 Nov 2022 at 10:23am
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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 03 Jan 2023 at 8:37am
You'll need two parameters instead of one - one for beginning and one for ending - you can't use a range prompt in a command. For a good explanation of working with params in commands see https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/, which I wrote several years ago. Even though it's older, the information is still relevant.

-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.