Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quarterly Comparison Results
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Quarterly Comparison Results
Miscellaneous
Thread ID:
00586640
Message ID:
00586640
Views:
53
Another day, another SQL question:

I need to get quarterly student counts, where a student could appear in multiple quarters, they need to be counted for each quarter.

My first question is simply why does this work...
SELECT MONTH(date) FROM service
but this doesn't...
SELECT QUARTER(date) FROM service
The latter returns an error: Function argument, date, type, or count is invalid

Other than the above, I'm wondering generally how best to tackle this problem. I'm want something like:
SELECT count(person_id), quarter(date);
  FROM service;
  GROUP BY quarter(date)
-- Larry Keyes
Remember only You can prevent Gray Goo. Never release nanobot assembers without replication limiting code.
Next
Reply
Map
View

Click here to load this message in the networking platform