este es el codigo de la consulta:
Código SQL:
Ver original
SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0102' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0728' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0755' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0761' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0799' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0829' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0868' AND tipsal='A' AND b.codperi<'017' UNION SELECT SUM(b.valsal) AS valsal2 FROM sno_personal a, sno_hsalida b WHERE a.cedper LIKE 'xxxxxxx' AND a.codper = b.codper AND b.codnom='0883' AND tipsal='A' AND b.codperi<'017'
[/CODE]
A y el sistema esta hecho en php
Muchas gracias de antemano