|
-
Jul 19th, 2006, 10:12 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] SQl query
Hi
I have an SQL server 2000 table that has a field called "Files".
I execute the following query:
Rs.open"Select Files from Books where BDate like ' &sdate1 & "'",cnn,adopenStatic,adlockoptimistic
it returned the following recordset
01daily.doc
05daily.pdf
04daily.doc
19daily.doc
16daily.doc
Now i want to select the record whose Files value begins with the highest number,in this case
it's 19daily.doc
how can i do it?
thanks in advance
-
Jul 19th, 2006, 10:15 AM
#2
Frenzied Member
Re: SQl query
Try this :
VB Code:
Rs.open"Select Files from Books where BDate like '" &sdate1 & "' order by Files desc",cnn,adopenStatic,adlockoptimistic
-
Jul 19th, 2006, 10:15 AM
#3
Frenzied Member
Re: SQl query
.. or if you JUST want the highest value, then :
VB Code:
Rs.open"Select max(Files) from Books where BDate like ' & sdate1 & "'",cnn,adopenStatic,adlockoptimistic
-
Jul 19th, 2006, 12:18 PM
#4
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|