DMAX Not working

  • Thread starter Thread starter matt via AccessMonster.com
  • Start date Start date
M

matt via AccessMonster.com

When i go to use my DMAX function it is not returning the correct largest
number.

For example here are two numbers CJ5250-100A & CJ5250-9A

The dmax returns the CJ5250-9A as the largest because the first digit is
larger then the other but obvioulsy the 100A is greater the 9A how do i get
this to work? Can it work?
 
The dmax returns the CJ5250-9A as the largest because the first digit is
larger then the other but obvioulsy the 100A is greater the 9A how do i
get
this to work? Can it work?

Since this is obviously a text field, 9A is greater that 100A. I doubt there
is anyway to get it to sort the way you want it to.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html
 
Matt

Unless you can isolate the numeric portion to which you want to apply the
"max" operation, it looks like you're stuck with an alpha-numeric sort.

Can you use the Left(), Mid(), and/or InStr() functions to isolate out your
"number"?

P.S. "numbers" can be added -- you have a "code"

Good luck

Jeff Boyce
<Access MVP>
 
matt via AccessMonster.com said:
When i go to use my DMAX function it is not returning the correct largest
number.

For example here are two numbers CJ5250-100A & CJ5250-9A

The dmax returns the CJ5250-9A as the largest because the first digit is
larger then the other but obvioulsy the 100A is greater the 9A how do i get
this to work? Can it work?

By now you probably realize that DMax is indeed returning the correct value,
though not the value that you had expected. It will not be difficult to
extract the largest value if your data has a fixed format. Does the number
you wish always begin in the 8th position? Always after a "-" character?
 
Back
Top