Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Records in a Report/Query

Status
Not open for further replies.

Dynapen

Programmer
Apr 20, 2000
245
US
I am building a report off of a query. The query needs to take the data, sort by the ID, then by date, and give only the most recent date for each ID. I have tried everything that i can think of including a totals query. Using the last/most functions in the query but to no avail.<br><br>This thing is kicking my butt. Any help you can give is greatly appreciated.<br><br>Thanks in advance.<br><br><br>
 
Did you try Group by<br>Here paste this in your<br>SQL part of your Query<br>--------------------------<br>SELECT Table1.ID, Max(Table1.Date) AS MaxOfDate<br>FROM Table1<br>GROUP BY Table1.ID;<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
I went to the field line in my query, right-clicked, selected Zoom, and entered the following <br><br><br>SELECT tbl Locations.SSN, Max(tbl Locations.Date Checked Out/In) AS MaxOfDate<br>FROM tbl Locations<br>GROUP BY tbl Locations.SSN<br><br>I keep getting a syntax error. I don't know enough about SQL to know exaclty how to fix it. <br><br>Help Please<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top