MAX is not seperating dates based on time (Seconds)

S

S Davis

Is there any way that I can seperate the maximum values based off of
the seconds in a field? I am trying to find the maximum values for
certains days in various months, but unfortunately they are not
entirely working if the seconds are only a few apart. Here's an exact
sample of what is returned:

MRC MaxOfDATE OBJECT MRC_History_MonthF
178 9/19/2006 1:30:56 PM 7279 1
178 2/23/2007 8:44:12 AM 7279 6
176 2/23/2007 8:44:34 AM 7279 6
179 3/27/2007 1:38:34 PM 7279 7
178 4/11/2007 1:53:49 PM 7279 8

Thanks if you can help me find out how to return only the maximum date
per month! :)
 
S

S Davis

Here's the SQL to return my first example. Otherwise I would not
filter on 7279, but the results are the same either way.

SELECT MRC_Making16Test1.MRC, Max(MRC_Making16Test1.DATE) AS
MaxOfDATE, MRC_Making16Test1.OBJECT,
MRC_Making16Test1.MRC_History_MonthF
FROM MRC_Making16Test1
GROUP BY MRC_Making16Test1.MRC, MRC_Making16Test1.OBJECT,
MRC_Making16Test1.MRC_History_MonthF
HAVING (((MRC_Making16Test1.OBJECT)="7279"));
 
S

S Davis

Fixed, thank you.



LastOfMRC MaxOfDATE OBJECT MRC_History_MonthF
178 9/19/2006 1:30:56 PM 7279 1
178 2/23/2007 8:44:34 AM 7279 6
179 3/27/2007 1:38:34 PM 7279 7
178 4/11/2007 1:53:49 PM 7279 8
 

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