Solved

importing numbers from access into sql with different format

Posted on 2011-03-09
4
305 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 38

Accepted Solution

by:
Aaron Tomosky earned 84 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 83 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 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 83 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now