Solved

finding a highest number in a database

Posted on 2003-11-28
5
262 Views
Last Modified: 2010-05-01
How do I search a database field for the highest value and return it to a text box in VBS?
0
Comment
Question by:mattewjones
5 Comments
 
LVL 9

Accepted Solution

by:
dancebert earned 25 total points
ID: 9840339
If it's a numeric field, the SQL is

SELECT Max( fieldName ) FROM tableName
0
 
LVL 1

Assisted Solution

by:gron
gron earned 25 total points
ID: 9842479
Or you can also SELECT (fieldname) ORDER BY (fieldname) DESC
and then read the first record
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now