Public TSec, TTur, TOpe, TRef, TOpc
Store Sys(2015) To TSec
Store Sys(2015) To TTur
Store Sys(2015) To TOpe
Store Sys(2015) To TRef
Store Sys(2015) To TOpc
Wait Window NoWait 'Buscando Información de Secciones'
*:! Información de las Secciones
Select Distinc 0 As Ok, CodSecc, Proper(NomSecc) As cSec From InSeccio ;
Where !Empty(CodSecc)Order By CodSecc Into Table (TSec)
Replace Ok With 1
Wait Window NoWait 'Buscando Información de Turnos'
*:! Información de los Turnos
Select 0 As Ok, Turno, 'De ' + Str(Hh_Inicio,2)+':'+IIf(Empty(Mm_Inicio), '00', Str(Mm_Inicio,2)) + ;
' a ' + Str(Hh_Fin,2)+':'+IIf(Empty(Mm_Fin), '00', Str(Mm_Fin,2)) As cHora ;
From SpTurnos Where !Empty(Turno) Order By Turno Into Table (TTur)
Replace Ok With 1
Wait Window NoWait 'Buscando Información de Operarios'
*:! Información de los Operarios
Select Distinc 0 As Ok, Operario, Proper(NombrEmpl) As cEmp From Inopera ;
Where !Empty(Operario) Order By Operario Into Table (TOpe)
Replace Ok With 1
Wait Window NoWait 'Buscando Información de Referencias'
*:! Información de los Referencias
Select Distinc 0 As Ok, Referencia, Proper(DescRef) As cRef From InRefer ;
Where !Empty(Referencia) Group By Referencia Order By Referencia Into Table (TRef)
Replace Ok With 1
Wait Window NoWait 'Buscando Información de Operaciones'
*:! Información de los Operaciones
uRef = &TRef .Referencia
Select 0 As Ok, Operacion, Referencia +' '+ Proper(DescOper) As cOpe, Referencia, TesMinu As TMin From InRefer ;
Where !Empty(Operacion) And Referencia = uRef Group By Referencia, Operacion Order By Referencia, Operacion Into Table (TOpc)
Replace Ok With 1
Use In InSeccio
Use In SpTurnos
Use In InOpera
Wait Clear
Local wWhere, wField, lTable1, lTable2, lTable3
Store '' To wWhere, wField
Store Sys(2015) To lTable1
Store Sys(2015) To lTable2
Store Sys(2015) To lTable3
Store ThisForm.F1.Value To Fec1
Store ThisForm.F2.Value To Fec2
*set step on
Store IIf(!Empty(ThisForm.NoImp.Value),'And Indiar.Referencia # "99999"', '') To wWhere
*:! Varias Secciones
If Empty(ThisForm.Checkgen1.Value)
wWhere = wWhere + ' And !Empty(S.Ok)'
EndIf
*:! Varios Turnos
If Empty(ThisForm.Checkgen2.Value)
wWhere = wWhere + ' And !Empty(T.Ok)'
EndIf
*:! Varois Operarios
If Empty(ThisForm.Checkgen3.Value)
wWhere = wWhere + ' And !Empty(O.Ok)'
EndIf
*:! Varias Referencias
If Empty(ThisForm.Checkgen4.Value)
wWhere = wWhere + ' And !Empty(R.Ok)'
EndIf
everything is ok. until here but the next sql select (like i say before just inthe server machine )
Select Indiar.*, cSec, cHora, cEmp, cRef, Space(40) As cOpc, Indiar.TesMinu As TMin, 00000 As Malas ;
From Indiar, &TSec S, &TTur T, &TOpe O, &TRef R ;
Where Indiar.CodSecc = S.CodSecc And Indiar.Turno = T.Turno ;
And Indiar.Operario = O.Operario And Indiar.Referencia = R.Referencia ;
And BetWeen(Indiar.FechaProd, Fec1, Fec2) &wWhere ;
Order By Indiar.FechaProd, Indiar.CodSecc, Indiar.Referencia, Indiar.Operalte, Indiar.Operacion, ;
Indiar.Operario, Indiar.Es_Extra ;
Into Table (lTable1)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only