on 02-23-2010 6:26 PM
Estimados amigos,
Tengo un query que barre pagos pendientes a facturas de compras evaluando dias de gracia como vencimiento, dicho query lo he programado con una alarma la cual debe estar esjecutandose cada 30 minutos durante todo el dia laboral. Pero la alarma no se ejecuta en ningún tiempo que le programe; la lógica del query usa getdate() para evaluar las transacciones abiertas para el transcurso del día. Lo raro es que es otra de las sociedades si funciona de manera normal y en esta otra sociedad no a pesar que al correrla en el query manager si devuelve resultados.
( SELECT T0.CardName, T0.DocNum As 'Documento', T0.DocDate As 'Fecha Documento', T0.DocDueDate As 'Fecha Vencimiento', T0.U_FactCom as 'Factura Comercial', T0.U_FactCont as 'Factura Contable', T0.U_PedidoIn as 'Pedido', T0.DocTotal As 'Total', T0.PaidToDate As 'Pagado', (T0.DocTotal-T0.PaidToDate) As 'Saldo' ,T0.DocTotalFC as 'Total $', (T0.DocTotalFC-T0.PaidToDate) as 'Saldo $', ABS(DATEDIFF(dayofyear,T0.DocDueDate,getdate())) As 'Dias' FROM OPCH T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode WHERE T1.QryGroup7 = 'Y' AND (T0.DocTotal-T0.PaidToDate) > 0 AND ABS(DATEDIFF(dayofyear,T0.DocDueDate,getdate())) <= (getdate() +(SELECT U_ValPar FROM .[@PARAMETROS] WHERE Code = 10)) and T0.DocDueDate <= (getdate() +(SELECT U_ValPar FROM .[@PARAMETROS] WHERE Code = 10)) and ((T1.CardCode ='P000001' or T1.CardCode ='P000760') or (T1.QryGroup13 = 'Y')) GROUP BY T0.CardName, T0.DocDate, T0.DocDueDate, T0.DocNum, T0.U_FactCom, T0.U_FactCont, T0.U_PedidoIn, T0.DocTotal, T0.PaidToDate, T0.DocTotalFC
)
atte.
Daniel
Eliminé el group by, y funcionó
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola.
Intenta dejando la sesión de usuario manager abierta en la compañía donde debe ejecutarse la alerta (habiendo agregado manager a los destinatarios de la alerta.
También puedes intentar modificando el intervalo de la alerta.
Revisa este otro caso que puede ser útil: .
Espero sea de ayuda.
Edited by: Hector Daniel Hernandez Bacca on Feb 23, 2010 4:04 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.