Solved

Access 2007 vba convert text to decimal

Posted on 2011-02-28
7
734 Views
Last Modified: 2013-11-27
I have several text (50) records that are imported thru an ODBC connection that reads ie 32.9.   I would like to convert to a number with one decimal point.   How do I convert it in VBA.
0
Comment
Question by:glomo82
  • 4
  • 2
7 Comments
 
LVL 75
ID: 35002994
csng("32.1")
returns
32.1 numeric

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
ID: 35002997
CSng(YourField)  to be exact
0
 
LVL 44

Expert Comment

by:GRayL
ID: 35003355
CDbl(myFld,"#.0")
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 75
ID: 35003368
But why change to Double that takes the storage ?
0
 
LVL 75
ID: 35003376
> That takes twice the storage ?
0
 
LVL 44

Expert Comment

by:GRayL
ID: 35003397
I was never told the value could not exceed 32768
0
 

Author Closing Comment

by:glomo82
ID: 35003473
Thanks a bunch
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question