Format query column as number

  • Thread starter Thread starter Jeff Klein
  • Start date Start date
J

Jeff Klein

I am trying to use a >6 in my query criteria but it is not working. I
suspect the problem is values in the column are not numbers. This query
comes from another query where values are extracted from a string. Is there
a way to format the column of a query to a "NUMBER"?
 
If the field is named Field1, try:
Val(Nz([Field1],"0"))

The Val() gives the numeric value of a string. It can't cope with Null, so
we convert the nulls to a string zero first.
 
Jeff said:
I am trying to use a >6 in my query criteria but it is not working. I
suspect the problem is values in the column are not numbers. This query
comes from another query where values are extracted from a string. Is there
a way to format the column of a query to a "NUMBER"?


Use a conversion function such as Val, CLng, etc. to make
the field a number:

Expr1: CLng(somefield)
 

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

Back
Top