• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

format a number to remove dashes?

I have the following query:

SELECT [Litho Data].TTLotID
FROM [Litho Data];

The data looks like:
545-217522.000

I need it to look like:   545217522

How do you do that?

Also  - it needs to be formatted to be a number and not a character string.
0
JoseDavila
Asked:
JoseDavila
  • 2
3 Solutions
 
Data-ManCOOCommented:
SELECT clng(Replace([Litho Data].[TTLotID],"-",""))
FROM [Litho Data];

Try that....Mike

0
 
CrossWiredCommented:
Check this out

http://www.experts-exchange.com/Databases/MS_Access/Q_21063512.html

To convert it to an integer use CInt()

Jay
0
 
GreymanMSCCommented:
Jay, CInt converts numeric string values to Integers, this is true, but only if they are short integers.  545217522 is too large to be an Integer value and thus CInt("545217522") will throw an overflow exception!  
 
CLng converts numeric string values to Long Integer and is more appropriate for values of this range.  
 
(PS: CDbl will convert such values into Double precision floating point values, if that is preferred.)
0
 
CrossWiredCommented:
yeah, i caught that as me and data-man posted almost simealtaneously, but since h already had it i didn't correct myself
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now