Solved

Exclude some records from report based on sku #

Posted on 2007-03-27
4
474 Views
Last Modified: 2013-11-28
I have a table called WebProducts with 250-300 records.  I want to exclude some records based on their product sku #.from the printed report.  This list of excluded records will change from time to time.   I would like to design a query that would specify which records to skip when report is printed.

Example:   iif([sku#] = 'ab003' or [sku#] = 'de003',skip,print).  About 5% of records will be skipped.  There is no other criterea, like if [color] = 'blue'
Thanks

David
0
Comment
Question by:DavidDF1913
  • 3
4 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 125 total points
ID: 18801789
make an exception table for just that list of SKUs and then use a Not IN(SELECT Sku# FROM tblException) as part of your report's query criteria
0
 
LVL 38

Assisted Solution

by:Jim P.
Jim P. earned 125 total points
ID: 18801799
I would create a table of like SKUs_To_Skip. Populate this table with the SKU # you don't want  to print.

Then your report is based on a query like:
SELECT *
FROM WebProducts
WHERE [sku#] Not In (SELECT Sku_Num FROM SKUs_To_Skip)
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18801826
<Naming Conventions>
Using spaces and special characters like the pound sign (#) in field names causes no end of problems. Even though M$ says you can, doesn't mean you should.
</Naming Conventions>
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 20013302
Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question