Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Update query in MS access

Posted on 2011-03-03
3
Medium Priority
?
247 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
[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 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 feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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…

618 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