Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Simple SQL help

Author  Topic 

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-08-19 : 14:37:19
I am trying to get a list of all SOPNUMBE for a period.
SOP101 is the header and 102 is the detail. Then I will sum up the extended price, but this right here is not compiling.

SELECT sop10100.SOPNUMBE, SOP10100.SOPTYPE, SOP10200.SOPNUMBE, SOP10200.SOPTYPE

From SOP10200.SOPTYPE = SOP10100.SOPTYPE AND SOP10200.SOPNUMBE = SOP10100.SOPNUMBE INNER JOIN

WHERE sop10200.CUSTNAME = 'Northern Tract'
AND SOP10100.DOCDATE BETWEEN 07/01/09 AND 07/31/09

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-08-19 : 14:42:35
[code]
SELECT a.SOPNUMBE, a.SOPTYPE, b.SOPNUMBE, b.SOPTYPE
FROM SOP10100 a
INNER JOIN
sop10200 b
On b.SOPTYPE = a.SOPTYPE
AND b.SOPNUMBE = a.SOPNUMBE
WHERE b.CUSTNAME = 'Northern Tract'
AND a.DOCDATE BETWEEN '20090701' And '20090731'[/code]
Go to Top of Page

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-08-19 : 14:56:23
Thank you Russel.
Go to Top of Page
   

- Advertisement -