?
Solved

importing numbers from access into sql with different format

Posted on 2011-03-09
4
Medium Priority
?
317 Views
Last Modified: 2012-06-22
I am importing a column from access to sql 2005 but the numbers in the column are formatted differently:  e.g.
2000
0.50
2.8
22.55
I would like all to have decimal 2 places.  the sql column is money format.  thanks
0
Comment
Question by:bar0822
4 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 336 total points
ID: 35090715
You can make the column a decimal(18,2) format or you can just cast it when you use it.
Select cast(numbercolumn as decimal(18,2)) from table

If you do that you could store it as a varchar or whatever.
0
 
LVL 9

Assisted Solution

by:kaminda
kaminda earned 332 total points
ID: 35091117
I would suggest you to import data to SQL Server's varchar column with the required length. And then covert it to money within SQL Server by casting it. This way you wont loose any data due to formating (At least it is minimal)
0
 
LVL 52

Assisted Solution

by:Gustav Brock
Gustav Brock earned 332 total points
ID: 35093276
Leave the numbers "as is" and format them to your liking when displayed.

/gustav
0
 

Author Comment

by:bar0822
ID: 35097666
I imported as is and imported into money column and now have 4 zeros after decimal point but will leave as is unless they want it changed.  I'll use a cast in select.  thanks for the replies.

0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

864 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