SQL Query-1

  • Thread starter Thread starter Van T. Dinh
  • Start date Start date
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.
 
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.
 
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
 
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.
 
Back
Top