A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

COUNTs



 
 
Thread Tools Display Modes
  #1  
Old October 1st, 2004, 12:29 AM
mark r
external usenet poster
 
Posts: n/a
Default COUNTs

Table1 is a "child table". It has 50 records.
Fields a

ID
date
detail

A special consideration for me is that more than one
record could have the same ID. 36 records have a date
equal to forms!form1!dateholder but 4 records have
duplicate IDs.

I want to count the unique-ID-records and get one single
number returned (32). This query will be a source for a
form which only displays the number of records equal to
forms!form1!dateholder

Select DISTINCTROWS ID, Count(table1.ID)
from Table1
Where date = forms!form1!dateholder

This doesnot seem to work. How do I code this? I don't
understand COUNT and DISTINCTROW.


Thanks
  #2  
Old October 1st, 2004, 01:35 AM
Tom Ellison
external usenet poster
 
Posts: n/a
Default

Dear Mark:

SELECT ID, Count(table1.ID) AS CountForID
FROM Table1
Where date = forms!form1!dateholder
GROUP BY ID

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


On Thu, 30 Sep 2004 16:29:35 -0700, "mark r"
wrote:

Table1 is a "child table". It has 50 records.
Fields a

ID
date
detail

A special consideration for me is that more than one
record could have the same ID. 36 records have a date
equal to forms!form1!dateholder but 4 records have
duplicate IDs.

I want to count the unique-ID-records and get one single
number returned (32). This query will be a source for a
form which only displays the number of records equal to
forms!form1!dateholder

Select DISTINCTROWS ID, Count(table1.ID)
from Table1
Where date = forms!form1!dateholder

This doesnot seem to work. How do I code this? I don't
understand COUNT and DISTINCTROW.


Thanks


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counts and Percentages Michael Worksheet Functions 6 June 27th, 2004 01:59 PM
Counts of subgroups and subsubgroups DMR5713 Setting Up & Running Reports 2 June 2nd, 2004 03:41 PM
Return Row Counts from External DB into Excel Mark T Worksheet Functions 1 October 19th, 2003 03:24 PM


All times are GMT +1. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.