Solved

change text to number data type

Posted on 2014-04-18
3
425 Views
Last Modified: 2014-04-18
Hello,
have a database that is created from others and long story- but question is- I have a query like the example am attaching- but based on different tables-
Is there a way in a query, or report or form to change the data type when in text - to number- for calculation purposes-
in my example:
I want to create a field called total:
which is scan number ( table1) minus ( enter number (tbl2) + outside number(tbl3)+ last number (tbl4))
textNumber.accdb
0
Comment
Question by:davetough
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40009118
I can't download the database at this time but you would use a function to extract the numeric value.

Val(tbl1.scannumber) - val(tbl2.enternumber) + val(tbl3.outsidenumber)+ val(tbl4.lastnumber)

I chose the Val() function.  This function extracts any LEADING numbers from a string.  It has some quirks though.  You might also look at CLng(), CInt(), CDbl(), and CSng() if what you have are all numbers just stored in a text field.

When I was first learning Access the most helpful resource was the list of available functions.  You can get it from help sorted by category.  The alpha sort is pretty useless unless you know what you are looking for but the category sort lets you see all the "date" functions together and all the "financial" functions, etc.  That allows you to make informed decisions on which function is more suitable.
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 40009119
Haven't looked at your sample yet but first try using the Val function ...

NewFieldName: Val([FieldName])


ET
0
 

Author Closing Comment

by:davetough
ID: 40009405
thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

695 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