Solved

Update query is not performing a multiplication

Posted on 2008-06-13
9
315 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21783242
that is correct  ~ approximately

the values are in inches  12"

12 * 12 * 12 * 0.000578703704  = 1.000000000512  cubic ft
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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
 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 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