Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update table
Message
From
21/04/2011 10:40:53
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01508025
Message ID:
01508033
Views:
37
This is the code for the insert
insert into cuotas(tiptra,anomat,numest,idcurso,idfamilia,escolar,mes,cuota,pendiente,
descuento,descuento2,concepto,fechacuota,fechadescuento,fecharecargo,numher,rnc,empresa,tipncf)
select 'CM' as tiptra,e.anomat,e.numest,e.idcurso,e.idfamilia,
@cano as ano,@mes as mes,r.cuota as cargo,r.cuota as pendiente,
descuento=case when c.idnivel=2 and e.descuento2=0 and e.numher=1 then r.cuota-r.hermano1 else  
case when c.idnivel=2 and e.descuento2=0 and e.numher=2 then r.cuota-r.hermano2 else 
case when c.idnivel=2 and e.descuento2=0 and e.numher=3 then r.cuota-r.hermano3 else 
case when c.idnivel<>2 and e.descuento2=0 then r.descuento else 0 end end end end,
e.descuento2,@meses+' Mensual Año '+@escolar,@fecha1,@fecha2,@fecha3,
e.numher,e.rnc,e.empresa,e.idtipncf
from estudiantes e,familias F,cursos c,cargos r
where e.idcurso=c.idcurso and e.completo=0 and e.idfamilia=f.idfamilia and r.idnivel=c.idnivel and 
e.status<3 and e.ano_escolar=@escolar and r.ano=@cano and r.idcurso=e.idcurso order by c.idnivel,e.idfamilia
Jose Manuel Ramirez
Previous
Reply
Map
View

Click here to load this message in the networking platform