[thelist] SQL: counting rows in access

Anthony Johnston . Antix tech at antix.co.uk
Thu Oct 3 07:40:01 CDT 2002


use select sum(mon), sum(tues) from table

cheers Ant.

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Jon Steele
Sent: 03 October 2002 13:29
To: Thelist at Lists. Evolt. Org
Subject: [thelist] SQL: counting rows in access


Hi

I have run into a problem. I am trying to do the following in Access SQL but
am now stuck. =(

I have a table with the following format:

------------------------------------------------
id | sun | mon | tues | wed | thur | fri | sat |
------------------------------------------------
1   true   true  false  true  false false false
2   false  false false  false true  true  true
3   false  true  false  false false false false
etc.
etc.

Now I need to know how many rows are true for each day...so the result set
should look like

---------------------------------------------
| sun | mon | tues | wed | thur | fri | sat |
---------------------------------------------
  45     43    23     80    43    12     4

(i.e. 45 rows have true for sun, 43 have true for mon, etc.)

Thanks in advance...any help is greatly appreciated.

Cheers,
Jon

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list