Printing Report

macamarr

Board Regular
Joined
Nov 1, 2002
Messages
52
Hello,
I have set up report to show fields of a table and it works fine. What I can't get the report to do is: Only print the last record from the table or the query. Can you please help or guide me in the right direction???
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi macamarr,

The min condition should do it for you,

Try SQL as follows:
SELECT TOP 1 Min(Tbl1.Field1) AS LastField1, Tbl1.Field1
FROM Tbl1
GROUP BY Tbl1.Field1
ORDER BY Min(Tbl1.key);

replace Tbl1 with your table name and Field1 with your field names. You can then just view the query in design grid, and add the other fields and joins as needed.

or

Make a new query, and drag the table of interest onto the design grid. Click the little summation(sigma?) icon on the button bar, it looks like an odd E. Now change the 'total' dropcombo on the field of interest to 'min'. Now click on the 'view' icon, select SQL, and change Top 5 Min() to Top 1 Min() like shown above.

This is basically the same thing explained in two slightly different ways...

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,522
Messages
6,160,308
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top