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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal newbie needs help!!!!

Status
Not open for further replies.

nogs

Technical User
Aug 3, 2001
89
GB
I am trying to create a report with the option of searching on 5 different criteria;
{ORD_HDR.cust_code} = {?Code} and
{ORD_CHS.bbe_date} = Date (0, 0, 0) and
{ORD_CHS.prod_cod} = {?Code} and
{ORD_CHS.ppal_num} = "" and
{ORD_HDR.des_datc} in Date (0, 0, 0) to Date (0, 0, 0)
This works fine if data is entered for each, what I would like it to do is search on 2,3 or 4 of these if requested - hope that makes sense!!!!!!!!!!!!
 
You'll need 5 parameters with each set to a default of *.
Then your selection becomes:
({ORD_HDR.cust_code} in [{?Code},"*"] AND etc etc
 
Andrew
Thinking about it a liitle more Numbers 1 & 2 should be compulsary - the last 3 are optional - if I understood your post correctly this is how I see it working, is this correct:
1{ORD_HDR.cust_code} = {?Code} and
2{ORD_CHS.prod_cod} = {?Code} and
3({ORD_CHS.bbe_date} = Date [(0, 0, 0),"*"] and
4{ORD_CHS.ppal_num} = ["","*"] and
5{ORD_HDR.des_datc} in Date [(0, 0, 0),"*"] to Date [(0, 0, 0),"*"])
 
Something like that - the syntax needs a bit of work!
Best of luck
Andrew Baines
Chase International, UK
 
Hello Roadkill
Have setup as per the instructions I am however getting errors when checking my formulas; here is the formula;

{ORD.cust_code} = "AC" and
if {?Batch} <> &quot;&quot; then {ORD.batch}= tonumber({?Batch}) or {?Batch} = &quot;&quot;)

When checking this Im being told that the filed doesnt exist - I did notice this was specified for Version 8 and we are only using 6.0 - could this be causing the problem??

Nogs
 
{ORD.cust_code} = &quot;AC&quot; and
if {?Batch} <> &quot;&quot; then {ORD.batch}= tonumber({?Batch}) or {?Batch} = &quot;&quot;)

the first and is superfluous - try

{ORD.cust_code} = &quot;AC&quot; {?Batch} <> &quot;&quot; then {ORD.batch}= tonumber({?Batch}) or {?Batch} = &quot;&quot;)
 
Sorry it took so long to have a look Andrew have been on holiday - however on testing your formula had the following error;

The remaining text does not appear to be part of the formula

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top