Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!!!! what is wrong with my query?

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
SELECT name, datediff("s", start_time, stop_time) /3600, count(name)
FROM usertime group by name

Help!!!! what is wrong with my query?
 
What is this used on, is the group by really and ORDERby, does it have to be capitalized.
 
ii128,

SELECT name, datediff("s", start_time, stop_time) /3600, count(name)
FROM usertime group by name

Count is an aggregate function that only returns one value. Try removing it and let us know what happens.

If it still has problems, try putting "as TotalTime" after the datediff call. I know that in QBE view, if you omit an Alias it supplies 'Expr1' as your alias. I'm not sure about running it in code.
John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top