Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Help with count

Author  Topic 

john_john
Starting Member

10 Posts

Posted - 2005-06-02 : 16:34:48
This is really urgent. I'd greatly appreciate it if someone can help me out. :)

I have the following table.

Table name: Sample

Date Mode
05/31/2005 A
05/31/2005 B
05/31/2005 A
05/31/2005 A
05/30/2005 B
05/30/2005 B
05/30/2005 B

I need to build a query that accepts date as a parameter and returns the count of each type of mode for the corresponding date as well as the total count of the number of modes on that date.

So for example, the output of the query could be something like this.

Date Count-A Count-B Total_Count
05/31/2005 3 1 4
05/30/2005 0 3 3

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-06-02 : 17:08:13
Please dont cross post
[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50613[/url]

Only joking

Couldnt you use a crosstab query then? This would give you what you want

Andy


Beauty is in the eyes of the beerholder
Go to Top of Page

john_john
Starting Member

10 Posts

Posted - 2005-06-02 : 18:32:41
Thanks Andy,

I was able to figure it out.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-06-03 : 15:33:08
You could check out this

http://weblogs.sqlteam.com/brettk/archive/2005/02/23/4171.aspx



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -