Re: Use of having with additional select
> I can't test because I have no access to your tables and test data, but
> try if the followiing does what you need:
Table CLPF08 sample data and relevant field information:
RAMO POLIZA CERVEH CODCOB MONTO1
31 6100265 2 1 20.15
31 6100265 2 2 30.10
31 6100265 2 3 15.02
Table ARYSAUTO sample data and relevant field information:
CERVEH PRIMA
2 65.26
My query shows a 0.01 monetary units of difference, since
20.15+30.10+15.02 is not exactly 65.26
The idea is to add all of MONTO1 in CLPF08 and compare that sum with
the lone value in table ARYSAUTO.
My query works, but using the HAVING statement to show up only those
records that have certain difference (we only need big differences,
not measly cents) doesn't work.
Your query executed, but it showed bizarre amounts.
Thanks for your help, i hope that this information is enough to fix
this |