Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to convert a Double to Integer

Status
Not open for further replies.

WoG18

MIS
Nov 12, 2003
2
US
I wrote a query to convert a double data type to an integer on the fly (In the Field area I call: (Expr1: dti(APPLICANT)))

here is the VBA:
Public Function dti(intExp)
Dim newInt, id
id = intExp
newInt = CInt(intExp)
dti = newInt
Return
End Function

I keep getting an overflow error when I preview the query results.

Should I convert the double in a seperate query? I can't believe that I can't convert a double to an integer. The double number is- 20060312673. Is that too big?

Thanks,
Jesse
 
An Integer holds values from -32768 to +32767.
A Long holds values from -2147483648 to 2147483647.
You may consider the Int function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top