Re: Convert text string to number in a query
- From: twalsh <twalsh@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Apr 2008 08:45:00 -0700
This seems to be progress, it is converting to number, however it is
rounding. Ex:
when Billable Hours= 8.40
CDbl(Val([Billable Hours])) returns 8.00
and Val([Billable Hours]) also returns 8.00
"raskew via AccessMonster.com" wrote:
Hi -.
Use the Val() function to convert a string to a number, e.g. from the Debug
(immediate) window:
x = "34.3"
? val(x)
34.3
To show that val(x)is a number
? cdbl(val(x))
34.3
HTH - Bob
twalsh wrote:
Ok i have an infopath form where users enter a number and it is stored into
an access database...
Problem is, Infopath throws a fit if you format those fields as numbers in
access.
I want to run a query that converts the text from the field into a number,
this is because the query will be used in a 'sendobject' macro that will
email data in an excel spread*** and the recipients need to be able to
manipulate and calculate with the data, which they can't do if it is sent as
text.
I tried using the expression "Int" as in Int([billable hours]), but it only
brought me the integer, the data thats entered is more like 7.69, 'int'
brought back 7, albeit it was in number format.
Am i on the right path or totally lost?
Please keep in mind i am a bit of a novice here....
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200804/1
- Follow-Ups:
- Re: Convert text string to number in a query
- From: raskew via AccessMonster.com
- Re: Convert text string to number in a query
- References:
- Convert text string to number in a query
- From: twalsh
- Re: Convert text string to number in a query
- From: raskew via AccessMonster.com
- Convert text string to number in a query
- Prev by Date: DateDiff Function
- Next by Date: Re: UPDATE QUERY - DECIMAL PLACES
- Previous by thread: Re: Convert text string to number in a query
- Next by thread: Re: Convert text string to number in a query
- Index(es):