Microsoft
Software
Hardware
Network
Question : How do I find the max number in a field formatted as text?
I am using the following code to try to find the highest number in a field. The problem I am having is that the field is formatted as text (nothing I can do about that) so when the "highest" number is 3666, I am getting the result of "97."
How do I get the max number in a text field as if it were actually a number field?
Thanks,
George
Code Snippet:
1: 2:
Dim maxordnum As Integer maxordnum = DMax("[ordnum])", "[srvinv]")
Open in New Window
Select All
Answer : How do I find the max number in a field formatted as text?
Dim maxordnum As Integer
maxordnum = cint(DMax("format([ordnum]
,""0000"")
", "[srvinv]"))
Random Solutions
Copy Excel and Paste Special into Outlook E-mail Message Body
Need to make a label visible on screen when record has been deleted but not yet cleared using Pack
Call main form refresh function
Does SingleOrDefault return null on multiple results?
How do I find the logged in Username from a batch file?
Choose either Office 2003/2007 to open office files
One way traffic over a hardware VPN
mqsvc.exe has generated errors - message at startup - what does it mean and why etc.?
Read and Change Control Value from Thread
How to enter a derived column in a SQL Server query being built using Access that provides if/then/else functionality