p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Free Code from Wrox
Go Back   p2p.wrox.com Forums > Database > SQL Language
I forgot my password
Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 10th, 2009, 01:18 PM
Friend of Wrox
Points: 941, Level: 11
Points: 941, Level: 11 Points: 941, Level: 11 Points: 941, Level: 11
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 201
Thanks: 4
Thanked 0 Times in 0 Posts
Question Add up quantities

I need to add gross and net quanties by "load" (which is the bill of lading number). My query still shows multiple rows with same load number (bol number)

Code:
 
select "load",
convert(varchar,Date,101),
branded,
name,
sum(cast(gross as decimal(15,2))), 
sum(cast(net as decimal(15,2)))
from [SFM-TP6000-1].TP6000.dbo.loadcomp as load1
inner join [SFM-TP6000-1].TP6000.dbo.product as prod1 on prod1.product = load1.branded
where load1.branded = 'ULS'

Last edited by snufse : July 10th, 2009 at 01:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 10th, 2009, 04:35 PM
Friend of Wrox
Points: 4,922, Level: 29
Points: 4,922, Level: 29 Points: 4,922, Level: 29 Points: 4,922, Level: 29
Activity: 76%
Activity: 76% Activity: 76% Activity: 76%
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,354
Thanks: 3
Thanked 72 Times in 71 Posts
Default

So where, in that, do you ever reference a bill of lading number???

And where is your GROUP BY, in any case.

Since this appears to be SQL Server (because of the "dbo." and the CONVERT with number 101), I can't believe you aren't getting an error message about the lack of GROUP BY.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 10th, 2009, 04:59 PM
Friend of Wrox
Points: 763, Level: 10
Points: 763, Level: 10 Points: 763, Level: 10 Points: 763, Level: 10
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 218
Thanks: 1
Thanked 7 Times in 7 Posts
Default

Snufse:

Need more information:
  • The BOL (Bill of Laden), in the Receiving Dept, defines what is on the Packing Slip. In the Shipping Dept, the BOL defined shipment and included additional info besides the detailed items, the order number and the truck ID, because some orders may be on multiple trucks, which meant multiple BOL with same order number. Need to know Receiving or Shipping?
  • Need you to define your "LOAD" besides saying its the BOL, Full Truck Load, Partial Truck Load, etc. and what is "UDS"?
  • It would help to know the process for receiving, before giving a response.
__________________
Disclaimer: The above comments are solely the opinion of one person and not to be construed as a directive or an incentive to commit fraudulent acts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 18: Automation Add-Ins and COM Add-Ins David Bibby BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 1 April 10th, 2009 06:47 AM
Subtracting Quantities rsm42 ASP.NET 1.0 and 1.1 Basics 2 January 7th, 2007 10:44 AM
Updating Quantities rsm42 ASP.NET 1.0 and 1.1 Basics 1 December 26th, 2006 06:54 AM
Add Push button or Check Box in outlook add-ins capdevs VS.NET 2002/2003 0 January 7th, 2006 08:51 AM
Trouble getting an "Update Quantities" Button attipa ASP E-commerce 0 August 12th, 2003 09:47 PM



All times are GMT -4. The time now is 11:13 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc