Sorry if I seemed "agitated". I guess it might be due to the fact that I
find it frustrating when I try to help and the OP either mis-informs or
under-informs. If your original question was:
My db has 6 fields all populated with numbers from 01-55
and there are 1404 records. How can I write a query to tell
me how many time each of the numbers (say number 8
comes up) in all of the fields?
My table is "PB" and my fields are ID, [Date of], PB#1,
PB#2, PB#3,...
John and I both supplied our WAGs about your table and field names and it
wasn't until several days and a dozen replies that this information was
discovered. Maybe we need to first ask you "what are your table and field
names". Some times we do and some times we don't.
--
Duane Hookom
MS Access MVP
--
tamxwell said:
Hey,
I changed the field names and it works perfectly. Again, sorry you seem a
bit agitated. Did not mean to mess with your head.
Todd
Duane Hookom said:
You actually have "#" in your field names but when you created your union
query, you ignored the "#"?
You should be able to figure out that the select statements are based on
your table and field names, not something you make up.
--
Duane Hookom
MS Access MVP
The Table, named PB and the structure is Field 1 is ID, Field 2 is Date
of,
Field 3 is pb#1, Field 4 is pb#2, Field 5 is pb#3, Field 6 is pb#4,
Field
7
is pb#5, Field 8 is pb#6.
:
Do you have a table named pb with fields pb1, pb2,...
Have you considered providing us with the actual table structure?
--
Duane Hookom
MS Access MVP
--
No does not work. I did notice the spaces and corrected . It just
keeps
prompting mr for the parameter value of pb.pb1, pb.pb2, etc. I also
wrote
another UNION a little different. Still prompts for Parameter
Value.
SELECT pb.[pb1] As MyNum
FROM pb
WHERE pb.[pb1] IS NOT NULL
UNION ALL
SELECT pb.[pb2]
FROM pb
WHERE pb.[pb2] IS NOT NULL
UNION ALL
SELECT pb.[pb3]
FROM pb
WHERE pb.[pb3] IS NOT NULL
UNION ALL
SELECT pb.[pb4]
FROM pb
WHERE pb.[pb4] IS NOT NULL
UNION ALL
SELECT pb.[pb5]
FROM pb
WHERE pb.[pb5] IS NOT NULL
UNION ALL SELECT pb.[pb6]
FROM pb
WHERE pb.[pb6] IS NOT NULL;
:
Does the union query by itself work? I did notice your field names
in
the
union query are incorrect. Sometimes you have spaces, other times
you
don't.
SELECT pb.[pb2]
FROM pb
WHERE pb.[pb 2] IS NOT NULL
--
Duane Hookom
MS Access MVP
--
It does not return any results. No error messages, just no
results.
When I
click on the query it asks for Parameter Value pb.pb1, then
pb.pb2,
etc...but no results.
:
On Tue, 4 Oct 2005 05:57:03 -0700, "tamxwell"
Nope...
If the Union query is saved as qryMyNum then yes, this should
work.
Doesn't it?
"Doctor, I don't feel good. What should I take?"
Please describe in what WAY it doesn't work. You can see your
screen... we cannot.
John W. Vinson[MVP]