|
Posted by Ray Greene on 10/12/05 12:37
SQL newbie alert...
I have a table with the fields Location, MachineName ,Hours and Date.
(The actual database is more complex but it will do for the purposes of this
post)
I want to return Location, MachineName and the sum of the hours between two
dates. Here is an idea of what I need, although obviously this code doesn't
work.
SELECT Location, MachineName, SUM(Hours)
FROM Table
WHERE Date BETWEEN date1 AND date2
I have experimented with various nested SELECT statements but with no
success. I'm new to SQL and out of my depth already, can anyone explain how
to do this?
Ray Greene.
Navigation:
[Reply to this message]
|