Ernesto_Paez
MIS
Hi Everyone
i just need to store the result of
Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout)) in a local variable i defined named "ltIn"
when i run the above code from the command window as "? Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout))"
i get the correct result, however in the below "cmd click event" when running the form, i get error "Function argument value, type or count is invalid" and this is pointing to "ltIn" and of course in the debugger the value of "ltIn =.F." but however all the values in here Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout)) shows the correct values.
by the way m.ldFrom it is datetime value and department.clockin it is character value
so this is what i have in my cmd click event
can anyone explain why i am doing wrong or why this behavior ?
Thanks in advance
i just need to store the result of
Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout)) in a local variable i defined named "ltIn"
when i run the above code from the command window as "? Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout))"
i get the correct result, however in the below "cmd click event" when running the form, i get error "Function argument value, type or count is invalid" and this is pointing to "ltIn" and of course in the debugger the value of "ltIn =.F." but however all the values in here Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout)) shows the correct values.
by the way m.ldFrom it is datetime value and department.clockin it is character value
so this is what i have in my cmd click event
Code:
Local lnPK, ldFrom, ldTo, lnptod, lndouble, lnbereav, lnjury, llSalary,ltIn,ltOut,lcdept
ldFrom = This.Parent.dtperiod1.valuefrom
ldTo = This.Parent.dtperiod1.valueto
Select empname
Locate For emppk=m.lnPK
If Found()
lcdept=empname.dept
Select department
Locate For deptcode =m.lcdept
ltIn=Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockin))
MESSAGEBOX(m.ltIn)
ltOut=Ctot(Dtoc(Ttod(m.ldFrom))+' '+(department.clockout))
MESSAGEBOX(m.ltout)
Endif
Thanks in advance