Only shown with criteria (1 Viewer)

J

jeanbabean

Guest
How do I show a field only if the criteria is met??
 

Jack Cowley

Registered User.
Local time
Today, 08:19
Joined
Aug 7, 2000
Messages
2,639
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.
 
J

jeanbabean

Guest
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)
 
R

Rich

Guest
Isn't it easier to group by unit? Or use a form/subform to show which units belong where.
 
J

jeanbabean

Guest
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

Registered User.
Local time
Today, 02:19
Joined
May 19, 2001
Messages
398
---------- 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

Super Moderator
Staff member
Local time
Today, 03:19
Joined
Feb 19, 2002
Messages
43,626
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.
 

Users who are viewing this thread

Top Bottom