Format query column as number

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"?
 
A

Allen Browne

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.
 
M

Marshall Barton

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)
 
Top