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!

parenthesis issue 2

Status
Not open for further replies.
Aug 12, 2004
949
US
All

Please have a look at my problem. I am sure it's easy, but I have worked on it quite a while now and can't quite get it right. I posted to correct myself and now my thread is slipping down the page, still an issue.

Thanks very much

Erik

thread149-1226301
 
Please try providing more explanation. Explain what you are getting versus what you want. I am unclear on what the problem is, and I think that is probably why others have not responded.

-LB
 
I have report that shows me a date, customer id, and a product code. I have parameters set up for all three. I want to have my users be able to pick any of these parameters and have the report display the results.

For example, if they want to see all products in a date range between 1/1/2006 and 4/5/2006 and not specify an actual product code or customer id, then the report will show all results in the date range.

If a user picks a date range of 1/1/2006 and 4/5/2006 and also wants to see just one product code like 'Product A' then it will show all Product A's between the date range.

Finally if the user wants to pick a date range, 'Product A' and also a specific customer ID such a '100' then it would only show product A with a Cust ID of 100 in the date range.

I hope this is more clear. Here is what I have for me formula that isn't working.

My expected results are if I pick any of the three, 1/3, 2/3, and all three

{OrderDtl.UnitPrice} <> 0.00

and

(
(
{OrderHed.OrderDate} = {?Month}
)
or
(
{OrderDtl.ProdCode} = {?ProductGroup}
)
or
(
{Customer.CustID} = {?CustomerID}
)

)

If I put in a date range, a group and customer id, it will give me more records than just the customer ID's specific group in that date range.

If I put in just like a date range and leave the other parameters blank, it will work.

Does this make more sense? Sorry for my not making myself more clear and for letting me know so.

Erik
 
Set defaults for the parameters, and code accordingly, as in:

{OrderDtl.UnitPrice} <> 0.00

and

(
if {?Month} <> cdate(1970,1,1) then
{OrderHed.OrderDate} = {?month}
else
if {?Month} = cdate(1970,1,1) then
true
)
and
(
...you get the idea...

-k
 
I kind of see what you are doing, but I don't understand why I need the if then else statements?

Thanks,

Erik
 
When you use the "or" statement, once one of the conditions is met, it doesn't evaluate the later clauses.

-LB
 
LB,

So, how do I get around this, or is it possible?

Thanks,

Erik
 
Do as I suggested.

(
if {?Month} <> cdate(1970,1,1) then
{OrderHed.OrderDate} = {?month}
else
if {?Month} = cdate(1970,1,1) then
true
)
and
if {?ProductGroup} <> "All" then
{OrderDtl.ProdCode} = {?ProductGroup}
else
if {?ProductGroup} = "All" then
true
)
and
(
if {?CustomerID} <> 0 then
{Customer.CustID} = {?CustomerID}
else
if {?CustomerID} = 0 then
true
)

Set default values for each parameter to match the above, or what makes sense for their types.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top