Jan wrote:
Quote:
Is it easy to create a query that counts the number of timestamps in a
table grouped by hour? |
Create two SQL queries:
SELECT EXTRACT(hour FROM yourtimestampfield) as tsHour FROM yourtable
save that query and call it q1.sql
Now in a second query:
SELECT tsHour, COUNT(*)
FROM q1.sql
GROUP BY tsHour
You can't do it in one step because Local SQL won't group by an extract.
Most other dialects will.
You can avoid querying a query by creating an Hours table with a single
field theHour and populate it from 1 to 12, then join to it in a single
query:
SELECT h.theHour, COUNT(*)
FROM yourtable, hours
WHERE EXTRACT(hour FROM yourtimefield) = theHour
GROUP BY theHour
Quote:
Or group people's ages based on their based on
today - DOB? |
In a QBE query:
table | DOB |
Then query the result with groupings. The ages given will be in days.
--
Larry DiGiovanni
Digico, Inc.
IT Consulting and Staffing Solutions
www.digicoinc.com
Check out www.thedbcommunity.com for Paradox resources.