cancel
Showing results for 
Search instead for 
Did you mean: 

Record Suppression

0 Kudos

How can I suppress Company records that have a 2019 invoice? In the example below, only "18 Express inc" should appear on the report. "ABS Repair Inc" should not appear because they have a 2019 invoice.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

...I only wish Parameters could be used in the Command.

Thank you again for the help!

0 Kudos

Very helpful. Thank you!

DellSC
Active Contributor
0 Kudos

The most efficient way to do this is going to be to use a Command (SQL Select statement) instead of linking tables together.

The query will look something like this:

Select <ALL of the fields you need for the report>
From Company c
  inner join AZInvoice a
    on c.Comp_CompanyId = a.azih_CompanyId
Where not exists (
  Select 1 
  from AZInvoice a1
  where a1.azih_CompanyId = c.Comp_CompanyId
  and a1.azih_InvoiceDate >= '01/01/2019')

Depending on what database you're using, the format for the date will probably be different. This will only return companies that don't have invoices in 2019. So, you won't need to suppress anything.

See this blog post for more information about how to use commands: https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/.

-Dell