Textbox: Max Column Value, Except...

  • Thread starter User via AccessMonster.com
  • Start date
U

User via AccessMonster.com

I need a textbox to show the highest value of a column within a table, but
exclude the values: 000, 994, 995, 996, 997, 998, and 999

Thanks
 
J

John W. Vinson

I need a textbox to show the highest value of a column within a table, but
exclude the values: 000, 994, 995, 996, 997, 998, and 999

Thanks

=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"

assuming that the column is of Text type. Leave off the ' marks if it's Number
(and be aware that 0, 00, 000, and 0000000000000 are all exactly the same
number).
 
U

User via AccessMonster.com

=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"

I wasn't able to get the code to work correctly. All I get is a "0"
 
J

John W. Vinson

=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"

I wasn't able to get the code to work correctly. All I get is a "0"

More info please. What's the name of the table? of the column? what's it's
datatype? what's actually in the column? what exact expression did you in fact
use?
 
U

User via AccessMonster.com

More info please.
What's the name of the table? "tblEmpList"

The column? "EmployeeID"

What's it's datatype? Text

What's actually in the column?
"000, 001,......999"
What exact expression did you in fact use?
=DMax("[EmployeeID]","[tblEmpList]","[EmployeeID]") Not In ('000','994','995',
'996','997','998','999')


Thank you for helping!!
 
J

John W. Vinson

More info please.
What's the name of the table? "tblEmpList"

The column? "EmployeeID"

What's it's datatype? Text

What's actually in the column?
"000, 001,......999"
What exact expression did you in fact use?
=DMax("[EmployeeID]","[tblEmpList]","[EmployeeID]") Not In ('000','994','995',
'996','997','998','999')


Thank you for helping!!

Misplaced premature parenthesis and quotemark:

=DMax("[EmployeeID]", "[tblEmpList]", "[EmployeeID] Not In ('000','994','995',
'996','997','998','999')")
 
U

User via AccessMonster.com

=DMax("[EmployeeID]", "[tblEmpList]", "[EmployeeID] Not In ('000','994','995', '996','997','998','999')")

Works Perfect!!!

Thank you!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top