Modify a Query

G

Guest

I'm using the following. It produces the result I need.

SELECT Min([ID]) AS TheID, [Date], [Time], [UnderlyingSymbol]
FROM BTA_Trades_PIPs
GROUP BY [Date], [Time], [UnderlyingSymbol];

I have some other fields (Field1,Field2 etc) and would like them to be
displayed but do not want the result of the query to be altered from the
original.

Is it possible ?

Thank you in advance
 
J

John Spencer

If you just want one of the values returned from the additional fields which
match up with your group of date, time, and symbol, use the FIRST aggregate

SELECT Min([ID]) AS TheID, [Date], [Time], [UnderlyingSymbol], First(Field1)
as Fld1, First(Field2) as Fld2
FROM BTA_Trades_PIPs
GROUP BY [Date], [Time], [UnderlyingSymbol];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top