Solved

Update query is not performing a multiplication

Posted on 2008-06-13
9
314 Views
Last Modified: 2013-11-27
I need to calculate the cubic feet for a box and I'm updating my table of items.

tblmasteritem.Pallet_Cube = (([investiga.Pallet_Length]*[investiga.Pallet_Width]*[investiga.Pallet_Height])*0.000578703704)

Whenever I run this query isntead of geting the Cubic Feet I get the cubic inches
It seems that either my formula is wrong or I'm doing something inclorrectly
UPDATE tblmasteritem RIGHT JOIN investiga ON tblmasteritem.Code = investiga.Code 

SET 

tblmasteritem.Length = [Box_Outside_Length], 

tblmasteritem.Width = [Box_Outside_Width], 

tblmasteritem.Height = [Box_Outside_Height], 

tblmasteritem.Weight = [Weight_per_Box], 

tblmasteritem.Cubic_Vol = [Cubic_Vol_per_box], 

tblmasteritem.Pallet_Length = [investiga.Pallet_Length], 

tblmasteritem.Pallet_Width = [investiga.Pallet_Width], 

tblmasteritem.Pallet_Height = [investiga.Pallet_Height], 

tblmasteritem.Pallet_Cube = (([investiga.Pallet_Length]*[investiga.Pallet_Width]*[investiga.Pallet_Height])*0.000578703704), tblmasteritem.HoraActualiza = Now();

Open in new window

0
Comment
Question by:TOPIO
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 21783205
what units are the length, width and height in?
0
 
LVL 10

Author Comment

by:TOPIO
ID: 21783213
inches.
And according Mr Google
1 cubic inches = 0.000578703704 cubic feet
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21783242
that is correct  ~ approximately

the values are in inches  12"

12 * 12 * 12 * 0.000578703704  = 1.000000000512  cubic ft
0
 
LVL 28

Expert Comment

by:omgang
ID: 21783245
The math looks correct to me.  12 in. x 12 in. x 12 in. x 0.000578703704 = 1 cu. ft.

If the units for length, width and height were actually in feet instead of inches you would be getting the result you are seeing
12 ft. x 12 ft. x 12 ft. x 0.000578703704 = 1278

I don't see anything wrong with the query either.
OM Gang
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 10

Author Comment

by:TOPIO
ID: 21783253
Therein lies the question dear om gang the query is correct the formula is correct so why in the name of the frosted miniwheats is this not working?

Any ideas?
0
 
LVL 28

Expert Comment

by:omgang
ID: 21783268
Not to insult but are you sure the units in table investiga are inches?  For a pallet I would imagine values such as
length = 48
width = 42
height = 48

OM Gang
0
 
LVL 10

Expert Comment

by:OnALearningCurve
ID: 21784607
TOPIO,

Can you post some example values you are putting in and getting out as a result?

for example:

l=12, h=48, w=12, Result=###

Cheers,

Mark.
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 21789570
As you are using Property names (Length, Width, Height)  for field names, you may get some cross talk.  If you can try using the same Name as the source - [Box_Outside_Length] in lieu of Length
0
 
LVL 44

Expert Comment

by:GRayL
ID: 21835042
Thanks, glad to help.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

911 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

24 Experts available now in Live!

Get 1:1 Help Now