frequency distribution and join

  • Thread starter bertusavius via AccessMonster.com
  • Start date
B

bertusavius via AccessMonster.com

I'm trying to create a frequency distribution on a large database containing
times.
The distribition itself works quite well, but there is one problem; when the
are no time-instances within a certain category, the caterogy is not included
within the query.

I tried a JOIN using a helper table containing all time-categories
('hulptijden'). But it simply doesn't work. What am I doing wrong here?

SELECT groeptabel.tijdsvlak, Count([2009].Id) AS AantalVanId, [2009].Datum,
hulptijden.hulpTijdsvlakken
FROM 2009, hulptijden LEFT JOIN groeptabel ON hulptijden.hulpTijdsvlakken =
groeptabel.tijdsvlak
WHERE ((([2009].RIT_TIJD_2) Between [start] And [einde]))
GROUP BY groeptabel.tijdsvlak, [2009].Datum, groeptabel.Id, hulptijden.
hulpTijdsvlakken
HAVING ((([2009].Datum)=#1/8/2009#))
ORDER BY groeptabel.tijdsvlak;

I hope the code is clear (category descriptions in Dutch)
 
V

vanderghast

Keep the old query, the one where some category were not included. Say it is
saved under the name q1. Then, make another query, with hulptijden AND q1:

SELECT hulptijden.hulpTijdsvlakken, tijdsvlak, Datum
FROM hulptijden LEFT JOIN q1
ON hulptijden.hulpTijdsvlakken = q1.tijdsvlak


and use that second query (which will automatically call q1).


Vanderghast, Access MVP
 
B

bertusavius via AccessMonster.com

Perfect solution. Works like a charm. Thanks!
Keep the old query, the one where some category were not included. Say it is
saved under the name q1. Then, make another query, with hulptijden AND q1:

SELECT hulptijden.hulpTijdsvlakken, tijdsvlak, Datum
FROM hulptijden LEFT JOIN q1
ON hulptijden.hulpTijdsvlakken = q1.tijdsvlak

and use that second query (which will automatically call q1).

Vanderghast, Access MVP
I'm trying to create a frequency distribution on a large database
containing
[quoted text clipped - 21 lines]
I hope the code is clear (category descriptions in Dutch)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top