find max value in one field, return values in other fields in same row

D

David Pelizzari

I am attempting to do some report automation. I have several fields I am
pulling from SQL that I want to quickly find the highest foperno for a
current fjobno on a given fdate and fshift, and return teh fcompqty, fpartno
and fdate. Below are a couple columns of my data for clarification.
Ideally I want to write this in the SQL query so all the end user has to do
is open teh spreadsheet and VOILA! Any help would be GREATLY appreciated!

fcompqty fdate fjobno foperno fpro_id fshift fcdept fpartno
53 1/1/2008 0:00 I1DD9-0000 50 161-12 3 14 21405
53 1/1/2008 0:00 I1DD9-0000 60 162-12 3 14 21405
14 1/1/2008 0:00 I1E4I-0000 158 183-03 3 01 21322
14 1/1/2008 0:00 I1E4I-0000 159 192-03 1 01 21322
9 1/1/2008 0:00 I1E6A-0000 70 183-09 3 14 21408
17 1/1/2008 0:00 I1E8F-0000 50 163-06 3 01 20447
17 1/1/2008 0:00 I1E8F-0000 60 163-06 3 01 20447
 

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