codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  complex sql count  sanderman at 09:44 on Tuesday, August 09, 2005
 

hi coders,

i have an access database with a table called rented
in this table there are 7 different paymethods and 8 different genres.... example

1 sms thriller
2 ideal thriller
3 sms horror
4 0906 romance

what is want to know is the following:

i filter the table by 'sms' then i get back 2 records
one with sms, thriller and one with sms, horror
i want to see how many times horror and thriller are present
with the query 'sms'

i tried looking into count but it gave no results

does anyone know how to achieve these totals

thanks for your help

Sander Kerstens
www.pixellabs.nl
info@pixellabs.nl


  Re: complex sql count  javabits at 19:09 on Tuesday, August 09, 2005
 

the following sql would work

select count(*), paymethods, genre
from rented
where paymethods = "sms"
group by paymethods, genre;

or since you already know the paymethod

select count(*), genre
from rented
where paymethods = "sms"
group by genre;

semper fi...








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Nested Javascripts
•  ISP says linefeeds are causing problems
•  Linker Error Unresolved External Borland Builder 2006
•  Have multiple ASP.NET web projects share pages and controls
•  Re: How can I read ASCII data file in C++
•  Trouble writing programs
•  Validation Problem
•  Date formating from user input
•  Need help for writing javascript code global empty fields validation


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006