I posted this in the SQL forum but is more appropriate for this forum.
I am working on recreating the check history report in Crystal to show freight cost per voucher. Using the apDisFil and apOpnHst tables I am able to return what I need except for lines that do not have a freight charge. Once I get past this I will add the apVenFil back in to complete the report.
Results
If anyone has done anything like this and could point me in the right direction it would be appreciated.
SQL 2000
Macola 7.6.100
Thanks,
Jake
I am working on recreating the check history report in Crystal to show freight cost per voucher. Using the apDisFil and apOpnHst tables I am able to return what I need except for lines that do not have a freight charge. Once I get past this I will add the apVenFil back in to complete the report.
Code:
select d1.dist_dt,
d1.dist_amt,d2.dist_amt,
(d1.dist_amt + d2.dist_amt) as TT,
d1.vchr_or_chk_no,
d1.mn_no,d2.mn_no,
op.chk_no,
op.pay_amt,
op.disc_taken
from apDisFil_sql d1
left outer join apOpnHst_sql op on d1.vchr_or_chk_no = op.chk_vchr_no
inner join apDisFil_sql d2 on d2.vchr_or_chk_no = d1.vchr_or_chk_no
where d1.vend_no = '000000000157'
and d1.mn_no =('30150000')
and d2.mn_no = ('71700000')
and op.chk_no = '23409'
order by d1.vchr_or_chk_no
Code:
20050812 497.96 37.62 535.58 40788 30150000 71700000 23409 530.24 5.36
20050812 1609.82 137.94 1747.76 40789 30150000 71700000 23409 1730.33 17.48
20050812 3575.99 200.64 3776.63 40794 30150000 71700000 23409 3738.91 37.77
20050812 259.90 12.54 272.44 40795 30150000 71700000 23409 269.72 2.72
20050812 2429.92 175.56 2605.48 40796 30150000 71700000 23409 2579.48 26.06
20050816 35.99 26.20 62.19 40889 30150000 71700000 23409 61.57 .62
If anyone has done anything like this and could point me in the right direction it would be appreciated.
SQL 2000
Macola 7.6.100
Thanks,
Jake