Finding 'Last' record in a query

G

Guest

I used the following to get the last record from a query. I want to get the
last record entered by date. I do not get the last record.

I used this in the FIELD query grid --
X: DatePart("yyyy",[YourDateField])&DatePart("m",[YourDateField])

I used this as Criteria in the query grid --
DatePart("yyyy",Date()-Day(Date()))&DatePart("m",Date()-Day(Date()))

Pleae help!
 
G

Guest

Try this instead to get the last record

Select Top 1 TableName.* From TableName Order By YourDateField 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

Similar Threads


Top