How to return only one row in Select * query

S

Snurre Sprett

Hi.

My query is:

"select * from Merge where Employee.EmployeeID = " &
lngSubId

Merge is a query merging two tables and lngSubId is the
EmployeeID on a subform.

There is a date field in here and I want to return only
the row with the highest date, as I am going to merge this
to Word..

How do I code this in VBA or the Merge query.?

Appreciate all hints and tricks..

Regards
Snurre
 
R

Ronald

select top 1 * from Merge where Employee.EmployeeID = " & lngSubId & "
ORDER BY MyDate DESC"
 
S

Snurre Sprett

Works fine, but I sorted in the Merge query..

-----Original Message-----
select top 1 * from Merge where Employee.EmployeeID = " & lngSubId & "
ORDER BY MyDate DESC"





.
 

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