displaying additional data that correlates to my query



I have a query that gets the following information from my tables

ProductName, Voltage, Current, Peak, TargetDifference
(Peak and target are the same unit)

I have created an additional query to retrieve the Peak that is closest to
the Target for each ProductName. The problem is that it is important to
display the corresponding Voltage and Current readings. When I try to set
this up I get the following error. "You tried to execute a query that does
not include the specified expresson 'Peak' as part of an aggregate function"



This is what I have so far that works the way I want it to.

SELECT [Flux Density Query].ProductName,MIN([Flux Density
Query].TargetDifference)
FROM [Flux Density Query]
GROUP BY ProductName;

This is the result from this.

ProductName TargetDifference
XXXX .01
YYYY .014


I would like it to look like this.
ProductName Voltage Current Peak TargetDifference
XXXX 2000 2000 2.735 .035
YYYY 3000 3000 1.356 .006
etc.
.



Relevant Pages

  • Re: displaying additional data that correlates to my query
    ... One approach would be to take the result of your GROUP BY query and do an ... the same ProductName have the same minimum TargetDifference. ... SELECT [Flux Density Query].ProductName,MIN([Flux Density ...
    (microsoft.public.access.queries)
  • Re: subform issue
    ... tblOrders - in the table itself, not a combobox control in a form - then i'd ... Design view, go to the city code field, click the Lookup tab in Field ... ProductName FROM tblProducts ORDER BY ProductName; ... The subform is bound to a query based on Orders and Order ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Limit field choices based on another field
    ... I'm not making sense of the SQL statement. ... ProductName ... Allen Browne - Microsoft MVP. ... > created the stored query: ...
    (microsoft.public.access.formscoding)
  • RE: QUERY DESIGN HELP
    ... which custId, productName, categoryName the customer wants to be listed under. ... At the moment I have a query that pulls all this info together. ...
    (microsoft.public.access.queries)