Advertisement
Advertisement
| 08.11.2008 at 01:07PM PDT, ID: 23639212 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: |
declare @begdate datetime
declare @enddate datetime
set @begdate = '20080601'
set @enddate = '20080630'
--<<<<<< add insert statement here >>>>>>--
SELECT c.debcode,t4.invoicenumber
FROM (
SELECT t1.transactionnumber, isnull(MIN(t2.matchid),0) AS matchid1, isnull(MAX(t2.matchid),0) AS matchid2
FROM banktransactions t1
INNER JOIN banktransactions t2 ON t2.transactionnumber = t1.transactionnumber AND
t2.type = 'W' AND t2.transactiontype = 'C' AND t2.status <> 'v'
WHERE t1.type = 'S' AND t1.transactiontype = 'Z' AND t1.status <> 'V'
GROUP BY t1.transactionnumber
HAVING COUNT(*) = 2
) AS sz_to_2wc
INNER JOIN banktransactions t3 ON t3.id IN (sz_to_2wc.matchid1, sz_to_2wc.matchid2) AND
t3.type = 'S' AND t3.transactiontype = 'Y' AND t3.status <> 'V'
INNER JOIN banktransactions t4 ON t4.matchid = t3.id AND
t4.type = 'W' AND t4.transactiontype = 'K' AND t4.status <> 'V'
join cicmpy c on t4.debtornumber = c.debnr
where t4.valuedate between @begdate and @enddate
and t4.debtornumber is not null
|