
10/06/2009, 14:14
|
 | | | Fecha de Ingreso: abril-2009 Ubicación: Buenaventura
Mensajes: 41
Antigüedad: 15 años, 11 meses Puntos: 0 | |
favor revisen este select me genera un error este select tal cual como esta puedo aplicarlo en codigo php?
que modificaciones debo hacerle?
Código:
select nmro_dcmnto as Factura, cdgo_clnte as Cliente, cdgo_prdo as Periodo,
fcha_dcmnto as fecha_fac, fcha_vncmnto as Vencimiento, fcha_ultmo_pgo
as Pago, vlor_incial as Valor, sldo as saldo,
(fcha_vncmnto - fcha_ultmo_pgo) as Dif
from mstro_crtra
where cdgo_tpo_d="FAC"
and cdgo_prdo between 200801 and 200812
and cdgo_clnte = 30397
into temp t1
select count(*) as menor
from t1
where saldo = 0
and Dif < 0
union
select count(*) as mayor
from t1
where saldo = 0
and (Dif = 0 or Dif > 0 )
|