Access formual format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do I make a left((x),3) formula into a number format? When I run it as a
make table query it comes out as text.

I have changed the properties to general number.

Will
 
Int(Left([x],3))

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| how do I make a left((x),3) formula into a number format? When I run it as
a
| make table query it comes out as text.
|
| I have changed the properties to general number.
|
| Will
 
Depends on the type of number you are getting with your formula.

CInt(Left(x,3)) - returns an integer number with no decimals
CLng(Left(x,3)) - returns an number and can have decimals (1.5, .05)

Guessing that since you are returning 3 characters that CInt will work for you.
I would test to make sure that a valid number was being returned to avoid errors.

IIF(IsNumeric(Left(X,3)),CInt(Left(X,3)),Null)

You can replace the Null with 0 or some other number if you don't want null to
be returned when IsNumeric is false.
 
Back
Top