Exclude records not matching criteria

sdawson

Registered User.
Local time
Today, 20:29
Joined
Apr 22, 2003
Messages
165
I am trying to print a report and exclude from the report records that do not match the results of an expression in a query. I have tried endless combinations and still can not get the report to print the records only matching the criteria.

I've attached an extract of the db to best explain.

The last expression in GHSQuery1 [PUflag], calculates the difference between the week number input (use 35 here as this displays the best results for this exercise). If the result is zero "0" then the record is to be printed. Any other result is to be excluded. I can not get this to happen on the report.

Help!
:confused:
 

Attachments

You need to set criteria in your query. Set the criteria for PUFlag to = 0 and youshould just get what you are looking for.

There seem to be errors in your query because it is displaying some fieds as #error. you need to look at the way you are calculating these fields
 
My mistake there Rabbie.
Wrong query included.
What you suggested is what I have tried in umpteen combinations.
Have a look at the attached and try what you have suggested.

Thanks
 

Attachments

Hi Steve

I had problems setting criteria on your query so I created a new query based on your one(GHSQuery1) as follows

SELECT GHSQuery1.Area, GHSQuery1.Address1, GHSQuery1.Postcode, GHSQuery1.Phone1, GHSQuery1.Address3, GHSQuery1.County, GHSQuery1.Address2, GHSQuery1.CustomerName, GHSQuery1.Towncity, GHSQuery1.Ondemand, GHSQuery1.MaxOfPudate, GHSQuery1.Pickup, GHSQuery1.NextPickup, GHSQuery1.WeekNum, GHSQuery1.ISOWeekNumber, GHSQuery1.PUflag
FROM GHSQuery1
WHERE (((GHSQuery1.PUflag)=0));

This query is just displaying data where PUflag = 0. If you build your report on this query you should get what you are looking for.

Good luck
 
Well you little cracker Rabbie.
Pity I'm flying down to Portsmouth next week or I would have bought you a pint on way down through Wiltshire.
Many thanks mate.
 

Users who are viewing this thread

Back
Top Bottom