Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT SUM Syntax

Status
Not open for further replies.

TomBarrand

Programmer
Joined
Aug 9, 2000
Messages
162
Location
GB
I have the following tables, FOB and FOB_Size

FOB FOB_Size

FOB_No PK FOB_No Key
Purch_Ord_Line_No FK Size_No Key
FOB_Date Size_Quantity
Detailed_Size_Quantity

I would like to select the SUM of Detailed_Size_Quantity where the FOB.Date is between two FOB.FOB_Dates.
Any suggestions would be appreciated

Thanks
 
Maybe something like this

Select Sum(FOB_Size.Detailed_Size_Quantity) From FOB Inner join FOB_Size on fob.fob_no = fob_size.fob_no where fob.fob_date > start date and fob.fob_date > end date

Hope this helps. If it's not what your looking for let me know.
 
This might be Ok.

Select Sum(FOB_Size.Detailed_Size_Quantity) From FOB Inner join FOB_Size on fob_size.fob_no = fob.fob_no where fob.fob_date is between
<startdate> and <enddate>

In the place of these start and end dates you can substitute some subquery statements related to fob.fob_date.
Be careful with dateformat, better use a convert function on the dates and make them of the same format before comparision.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top