SQL Query-1

V

Van T. Dinh

Note for potential respondents: this is the 3rd post-dated message from the
poster.

--
Van T. Dinh
MVP (Access)




D.Nandakumar said:
Hi,

Thanks for the reply.

Please consider 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

here i want to select the images where the date is NOT letest.
In this case i want extrac the first 6 rows. How?

Thanks in advance.

Nandha.


Hi,


Well, accordingly to the data you supplied:

SELECT *
FROM myTable
WHERE [date]=( SELECT MAX([date])
FROM myTable )


Hoping it may help,
Vanderghast, Access MVP


D.Nandakumar said:
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.
 
V

Van T. Dinh

The post is dated later than the actual posting date & time so that it
appears on top of other posts (in the usual view) to get more attention,
i.e. trying to get unfair advantage over other posts.
 
D

D.Nandakumar

Hi,

Thanks for the reply.

Please consider 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

here i want to select the images where the date is NOT letest.
In this case i want extrac the first 6 rows. How?

Thanks in advance.

Nandha.


Hi,


Well, accordingly to the data you supplied:

SELECT *
FROM myTable
WHERE [date]=( SELECT MAX([date])
FROM myTable )


Hoping it may help,
Vanderghast, Access MVP
 
J

John Spencer (MVP)

So, change the = to <> (not equal) or < (Less than)....

D.Nandakumar said:
Hi,

Thanks for the reply.

Please consider 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

here i want to select the images where the date is NOT letest.
In this case i want extrac the first 6 rows. How?

Thanks in advance.

Nandha.

Hi,

Well, accordingly to the data you supplied:

SELECT *
FROM myTable
WHERE [date]=( SELECT MAX([date])
FROM myTable )

Hoping it may help,
Vanderghast, Access MVP

D.Nandakumar said:
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

Top