View Full Version : Only shown with criteria


jeanbabean
07-17-2001, 06:23 AM
How do I show a field only if the criteria is met??

Jack Cowley
07-17-2001, 06:41 AM
A few more details of what you are trying to do will help get you a more specific answer. If you have a query and you put in the criteria that you want and run the query you will see all the records that meet your criteria. You can create a form based on your query and when you open the form the filtered data from the query will be displayed.

jeanbabean
07-17-2001, 06:48 AM
I have a query of every pager on a nurse unit. I am taking the pager information directly from my pager table. The pager table consists of the pager history of each unit it has been used at.

I would like to do something like a huge if then else statement.

If Pager1 belongs to this unit, show up; else if Pager2 belongs to this unit, show up; else if Pager3 belongs to this unit show up. If the Pager1 or Pager2 or Pager3 does not belong to unit, do not show up (in the query or the form)

Rich
07-17-2001, 07:20 AM
Isn't it easier to group by unit? Or use a form/subform to show which units belong where.

jeanbabean
07-17-2001, 09:04 AM
If I group by unit, then I must have two tables of information, where if I just make a query off of the pager history/information, I only need one table.

The pager history shows each unit it has been used at : Unit1, Unit2, Unit3, Unit4.
I have a query setup so that for each unit, it looks to see if its Unit1, Unit2, Unit3, or Unit4 and then pulls the pager information from that. So I know which unit has what pager. The only problem is that when I pull the information, it shows the past units of that pager, which I do not want it to show....I only want it to show the current unit (where the date the pager has left the unit is null and the previous units has a date that is not null).

Any suggestions?? Anyone, please help!!!

pcs
07-17-2001, 04:13 PM
---------- you wrote------
If I group by unit, then I must have two tables of information, where if I just make a query off of the pager history/information, I only need one table.
---------------------------

what are the fields in your 'pager history/information' table?

al

Pat Hartman
07-18-2001, 05:21 AM
Add selection criteria to the query. Open the query in QBE view. In the criteria line for the DateThePagerLeftUnit column put:
Is Null

The query will then only return rows where the "end" date is null.