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

Record and Group selection issue

Status
Not open for further replies.

towntopic

Technical User
May 15, 2003
103
US
I have an issue with a report I just created. The report is a tool usage report for a specific date range. Within the Record selection formula I have the date formula and they work fantastically. However, I need to not pull in usage records for items with a specific vendor ID

{ITEMS.Vendor_Id} <> "52705"
AND
{ITEMS.Vendor_Id} <> "96002"
AND
{ITEMS.Vendor_Id} <> "92054"

The ITEMS table is linked to the TRANSACTION table which would be the main table for the report. Whenever the above code is added to the record selection formula, Crystal bombs out (generates errors). I can get around this by placing the code into the Group Selection formula where {ITEMS.Vendor_Id} is Group#1 and I get the correct data to show up, but now my running total fields are incorrect. The values are the same with the records or without the records. Any ideas on how to fix this?
 
try

not({ITEMS.Vendor_Id} in ["52705","96002","92054"])
 
You should be able to add it to your record selection criteria without getting an error.

Can you post your full selection criteria that you had when it bombed? Did you get specific error back from crystal stating what was wrong?

Here is an example of something that should work for you:

{ITEMS.your_date} in lastfullweek
and
not({ITEMS.Vendor_ID} in ["52705","96002","92054"])

You need to replace the first line with your existing, working date range selection line.

~Brian
 
I've tried using the not({ITEMS.Vendor_ID} in ["52705","96002","92054"]) and the end user reported some strange results. Honestly, I've always seen the correct results using that formula but to satisfy them, I change to the way you see below to make them feel warm and fuzzy. Still no luck. The error is a general WindowsXP "the program performed and illegal operation and will now be shut down" error with the ability to view the error log. Here's the code that produces the bomb out error. Once again, if I take the not({ITEMS.Vendor_ID} in ["52705","96002","92054"]) in Group Selection all is dandy except for the running totals. Thanks again.



{TRANSACTIONS.Condition} = "N"
AND
(
//THIS WORKS FOR BETWEEN
If {?~DATE1} > "" and {?~DATE2} > ""
Then {TRANSACTIONS.Checkout_Date} in {?~DATE1} to {?~DATE2}

//THIS WORKS FOR LESS THAN
Else If {?~DATE1} = "" And {?~DATE2} > ""
Then {TRANSACTIONS.Checkout_Date} <= {?~DATE2} or IsNull({?~DATE2})

//THIS WORKS FOR GREATER THAN
Else If {?~DATE2} = "" And {?~DATE1} > ""
Then {TRANSACTIONS.Checkout_Date} >= {?~DATE1}

//THIS WORKS FOR ALL
Else If {?~DATE1} = "" and {?~DATE2} = ""
Then {TRANSACTIONS.Checkout_Date} >= {?~DATE1}
)
AND
(
{ITEMS.Vendor_Id} <> "52705"
AND
{ITEMS.Vendor_Id} <> "96002"
AND
{ITEMS.Vendor_Id} <> "92054"
)
 
I got it to finally work by switching around the way the database tables link together. Sorry for the general mistake on my part and thanks for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top