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

Select Expert Help Needed

Status
Not open for further replies.

nogs

Technical User
Aug 3, 2001
89
GB
Im new to Crystal and Im trying to setup a report prompting the user for input to search a mysql database for - what I would like to do is if there is no input for one of the criteria then all records are selected - at the minute if I leave one balnk no data is selected. Summary of the formula below - Thanks for any help in advance;

{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)
 
If isnull({?parmfiled}) then False else

<<normal selection logic>>

will return no records if a parameter is null. Is this what you want?

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
are you trying to find instances where these fields are NULL??

if so try this

{ORD_HDR.cust_code} = {?Code} and
isnull( {ORD_CHS.bbe_date}) and
{ORD_CHS.prod_cod} = {?Code} and
isnull( {ORD_CHS.ppal_num}) and
isnull( {ORD_HDR.des_datc})

this will work if all values are null but if you want it if one of them is Null then use

{ORD_HDR.cust_code} = {?Code} and
{ORD_CHS.prod_cod} = {?Code} and
isnull( {ORD_CHS.bbe_date}) or
isnull( {ORD_CHS.ppal_num}) or
isnull( {ORD_HDR.des_datc})

this does bother me a little

{ORD_HDR.des_datc} in Date (0, 0, 0) to Date (0, 0, 0)

what is the purpose of this? 0,0,0 is not the begining of time...Think it is something like dec 31,1899 or something close to that...or do you want a parameter date range there?
Jim
JimBroadbent@Hotmail.com
 
What I want is if a value isnt specified all records are displayed -

ie if I entered;
nothing for: ORD_HDR.cust_code,
but entered 123 for{ORD_CHS.prod_cod}
nothing for: {ORD_CHS.ppal_num}
nothing for: {ORD_HDR.des_datc}
but entered 01/02/01 for {ORD_CHS.bbe_date}
then all records with a prod_cod=123 with a bbe of 01/02/01 irrespective of the others being blank would be displayed.

Does that make sense?!&quot;

{ORD_HDR.des_datc} in Date (0, 0, 0) to Date (0, 0, 0) is a
parameter date range
 
Ngolem
I will be entering date range here to search in;{ORD_HDR.des_datc} in Date (0, 0, 0) to Date (0, 0, 0)

TA Nogs

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top