[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Update query in MS access

Posted on 2011-03-03
3
Medium Priority
?
251 Views
Last Modified: 2012-05-11
I made an access table from data in MS excel that needs to be used to update data in a sql server table.  I have the update query setup, but the data is currency, and when I run the update query, I am getting several decimal places to the right of the decimal point, and I only want two.  The data type of the sql server fields are float.  Can I convert this data that I am updating from to be able to get it into sql server as only 2 decimal places?

sql query:

UPDATE [Inventory Value] LEFT JOIN dbo_Operation1 ON ([Inventory Value].Seq = dbo_Operation1.nSequence) AND ([Inventory Value].PartID = dbo_Operation1.idPart) SET dbo_Operation1.qStdCost = [Inventory Value]![Std Cost (Calc)], dbo_Operation1.qCustomCost = [Inventory Value]![Cum Step Value]
WHERE ((([Inventory Value].PartID)=2430));


0
Comment
Question by:sannunzi
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35027801
try this


UPDATE [Inventory Value] LEFT JOIN dbo_Operation1 ON ([Inventory Value].Seq = dbo_Operation1.nSequence) AND ([Inventory Value].PartID = dbo_Operation1.idPart)
SET dbo_Operation1.qStdCost = formatnumber([Inventory Value]![Std Cost (Calc)],2), dbo_Operation1.qCustomCost = formatnumber([Inventory Value]![Cum Step Value],2)
WHERE ((([Inventory Value].PartID)=2430));
0
 
LVL 2

Accepted Solution

by:
clayhopkins earned 2000 total points
ID: 35032173
What about wrapping the currency values in a SQL ROUND() function:
dbo_Operation1.qCustomCost = ROUND([Inventory Value]![Cum Step Value], 2)

Open in new window

0
 

Author Closing Comment

by:sannunzi
ID: 35033021
Thanks so much!  I think I tried everything but that.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
I came across an unsolved Outlook issue and here is my solution.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

873 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