I have a cursor like this and I want a varchar field.
<Create Cursor Emp_Dtl(cFact C(5) Null,nEmpNo N(15,0) Null,cFullName C(60) Null,cDepartment C(50) Null,dJoin D Null,dResign D Null,Months int Null,Years int Null, Days int Null, Period c(100) Null)
SELECT Emp_Dtl
Append From Dbf('Emp_Detl')
SELECT Emp_Dtl
SCAN
_Years = (year(dResign) - year(dJoin)) + 'Years' ****5 Years****
_Months = (abs(month(dResign) - month(dJoin)) ) + 'Months' ****10 Months****
_Days = (abs(day(dResign) - day(dJoin)) ) + 'Days' ****5 Days****
SELECT Emp_Dtl
REPLACE Period WITH _Years + _Months + _Days
ENDSCAN>
How can I update my Period field as '5 Years 10 Months 5 Days'.
Thank you
<Create Cursor Emp_Dtl(cFact C(5) Null,nEmpNo N(15,0) Null,cFullName C(60) Null,cDepartment C(50) Null,dJoin D Null,dResign D Null,Months int Null,Years int Null, Days int Null, Period c(100) Null)
SELECT Emp_Dtl
Append From Dbf('Emp_Detl')
SELECT Emp_Dtl
SCAN
_Years = (year(dResign) - year(dJoin)) + 'Years' ****5 Years****
_Months = (abs(month(dResign) - month(dJoin)) ) + 'Months' ****10 Months****
_Days = (abs(day(dResign) - day(dJoin)) ) + 'Days' ****5 Days****
SELECT Emp_Dtl
REPLACE Period WITH _Years + _Months + _Days
ENDSCAN>
How can I update my Period field as '5 Years 10 Months 5 Days'.
Thank you