473,394 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Query/report problem - display total records for each of 20 queries

I have 20 queries that compare fields in one table with fields in
another table - the query results are the records that do not match in
Table1 and Table2. ie

Table1
DOB 28/02/78

Table2
DOB 27/02/78

This example would show up in my DOB query.

Because I have so many queries is is possible to count how many records
are in each query? Either to display the total count for each query in
a report or in another query.

I've tried DCount function in the query window (added a further column
to the original 20 queries)but it doesnt look like i want it to (shows
no of records on each row/record)

I've tried placing all the queries in a new query and using Expr1:
Count(*) for each of the 20 queries but "query too complex"is
displayed.

I just hope that I dont have to create a count (*) query for each of my
20 queries.

Any help would be greatly appreciated!!

Nov 13 '05 #1
6 2538
On 23 May 2005 08:02:46 -0700, ge*********@hotmail.com wrote:
I have 20 queries that compare fields in one table with fields in
another table - the query results are the records that do not match in
Table1 and Table2. ie

Table1
DOB 28/02/78

Table2
DOB 27/02/78

This example would show up in my DOB query.

Because I have so many queries is is possible to count how many records
are in each query? Either to display the total count for each query in
a report or in another query.

I've tried DCount function in the query window (added a further column
to the original 20 queries)but it doesnt look like i want it to (shows
no of records on each row/record)

I've tried placing all the queries in a new query and using Expr1:
Count(*) for each of the 20 queries but "query too complex"is
displayed.

I just hope that I dont have to create a count (*) query for each of my
20 queries.

Any help would be greatly appreciated!!


I think what you could do is make a table of query names, then use DCount,
passing '*' as the Expr argument, and the query name field value as the Domain
argument.
Nov 13 '05 #2
Could you explain how I would do this please - I've created a new table
with column headings the same as the actual queries. But I cant do the
rest.........

Thankyou

Nov 13 '05 #3
On 24 May 2005 01:36:08 -0700, ge*********@hotmail.com wrote:
Could you explain how I would do this please - I've created a new table
with column headings the same as the actual queries. But I cant do the
rest.........

Thankyou


That's not what I meant. I meant you would have a table with one field, and
each row of the table holds the name of one query. Then you just write a
query of that table that executes DCount using the field value from the table
of queries as the Domain argument. The result should be a set with one row
for each of the queries, showing the count of each one. If you have to have
that in a horizontal layout, you can do a crosstab.
Nov 13 '05 #4
Thankyou you very much, just one other small problem when I use
DCount(*, Field1) an error occurrs

Field1 is the only field from the table of queries and I used the above
expression in a query of that table like you suggested!

I know I'm writing the expression wrong but have tried for hours now
and I simply cannot do it. How does the DCount know that I want to use
the field1 value( link to the query name)?

Many Thanks

Flick. x

Nov 13 '05 #5
If you typed exactly what you said...
DCount(*, Field1)
then yes, you would get an error. What you need is...
DCount('*', Field1)

On 25 May 2005 02:45:13 -0700, ge*********@hotmail.com wrote:
Thankyou you very much, just one other small problem when I use
DCount(*, Field1) an error occurrs

Field1 is the only field from the table of queries and I used the above
expression in a query of that table like you suggested!

I know I'm writing the expression wrong but have tried for hours now
and I simply cannot do it. How does the DCount know that I want to use
the field1 value( link to the query name)?

Many Thanks

Flick. x


Nov 13 '05 #6


Steve Jorgensen wrote:
If you typed exactly what you said...
DCount(*, Field1)
then yes, you would get an error. What you need is...
DCount('*', Field1)

On 25 May 2005 02:45:13 -0700, ge*********@hotmail.com wrote:
Thankyou you very much, just one other small problem when I use
DCount(*, Field1) an error occurrs

Field1 is the only field from the table of queries and I used the above
expression in a query of that table like you suggested!

I know I'm writing the expression wrong but have tried for hours now
and I simply cannot do it. How does the DCount know that I want to use
the field1 value( link to the query name)?

Many Thanks

Flick. x


Thankyou very much - it worked!!!

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sondra Wilson | last post by:
I have created a sorted query. The total(records) I get in the query is correct. My problem lies with getting that total into my report. I use count to insert the total number of records in my...
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
6
by: Brian | last post by:
Hello, Basically, I'm running a query on a form's activation, and I'd like to have the results of the query be placed into other fields on the same form automatically. Does anybody know how...
2
by: carl.barrett | last post by:
Hi, I'm back with the same question as I still can't get it to display my data the way I want it to. The table lists information about a perpetrator involved with an anti social behaviour...
4
by: Scott Cameron | last post by:
Here is what I have. I have a field that lists a product cost and another field that lists how many times that particular product has been purchased (so I would have a record that says I bought 25...
5
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
1
by: tom.youdan | last post by:
Hi, I have an access dbs with 2 key tables. One is a State table that has State id and State name fields. This feeds a combo box in a form to provide a reference point for the State Id field in...
4
by: dancole42 | last post by:
So I have an invoicing database based on two main forms: Orders and OrderLines. Orders has fields like: OrderID BillingMethod OrderDate CreditCard CCExp OrdSubTotal ShippingCharge
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.