SQL Query

  • Thread starter Thread starter Tom Wickerath
  • Start date Start date
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.
 
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.
 
Back
Top