Solved

Update query is not performing a multiplication

Posted on 2008-06-13
9
313 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

747 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

9 Experts available now in Live!

Get 1:1 Help Now