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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a query?

Status
Not open for further replies.

tamer64

IS-IT--Management
Aug 27, 2007
120
US
Can someone explain to me what this mean and how do correct the query?
"You tried to execute a query that does not include the specified expression "Barcode Assignment" as part of the aggregate function"


SELECT Test2.Barcode_Assignment, Format((Sum([ Test2]![SumOfTotal_Time])-Int(Sum([Test2]![SumOfTotal_Time]))),"hh:nn:ss") AS New
FROM Test2;
 
Doing a little research...I understand. Problem solved.
 
In case anyone is searching the net for an Answer, the use of the aggregate sum means that all fields have to be used in either an aggregate function or in a group by clause.

Code:
SELECT Test2.Barcode_Assignment, Format(([red]Sum[/red]([ Test2]![SumOfTotal_Time])-Int(Sum([Test2]![SumOfTotal_Time]))),"hh:nn:ss") AS New
FROM Test2
Group By [red]Test2.Barcode_Assignment;[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top