Solved

finding a highest number in a database

Posted on 2003-11-28
5
263 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DO Loop not working 4 72
ms access #TYPE! error on report when no data 4 63
Excel Vlookup to move data back to source. 4 83
VBA open file from excel cell 4 36
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

948 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

17 Experts available now in Live!

Get 1:1 Help Now