SQL Query

T

Tom Wickerath

How about the following SQL statement. I used "tblDetails" as the name of the table.

SELECT TOP 1 Mobile, MyName, MyDate
FROM tblDetails
ORDER BY MyDate DESC;

I changed the field names you indicated from "name" and "date" to "MyName" and "MyDate",
respectively. The reason I did this is because you used two reserved words for field
names. See the following KB article for more information:

Reserved Words in Microsoft Access
http://support.microsoft.com/?id=209187


Tom
______________________________________


Hi i have a table like this

mobile name date
------- ----- ----
9441212345 xyx 01/01/03
9441212345 xyx 01/01/03
9441212345 xyx 01/01/03
9441212345 abc 05/15/03
9441212345 abc 05/15/03
9441212345 abc 05/15/03
9441212345 pop 01/01/04
9441212345 pop 01/01/04
9441212345 pop 01/01/04

i want to select mobile nos for which date is latest. in this i want to
extract only the last 3 rows

How to do this.

thanks in advance.

Nandha.
 
D

D.Nandakumar

Hi i have a table like this

mobile name date
------- ----- ----
9441212345 xyx 01/01/03
9441212345 xyx 01/01/03
9441212345 xyx 01/01/03
9441212345 abc 05/15/03
9441212345 abc 05/15/03
9441212345 abc 05/15/03
9441212345 pop 01/01/04
9441212345 pop 01/01/04
9441212345 pop 01/01/04

i want to select mobile nos for which date is latest. in this i want to
extract only the last 3 rows

How to do this.

thanks in advance.

Nandha.
 

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