Hi all I am working on a import script from a payroll software to a legacy foxpro app and need to figure out this last portion and I have literally exhausted myself searching online and could really use a hand. Never coded with VFP9 prior to this, so here goes...
LOCAL lcunion, lcclassid
CREATE CURSOR Tsheets (username C (45),;
empid C (6),;
fname C (45),;
lname C (45),;
num C (45),;
group C (45),;
workdate C (10),;
day C (3),;
start C (45),;
end C (45),;
timezone C (2),;
hoursr N (6, 2),;
jobname C (45),;
trackid C (4),;
classid C (2),;
wcid C (2),;
jobid C (45),;
unionid C (2),;
location C (45),;
notes C (254),;
approved C (45),;
glid C (3),;
craftid C (3),;
rater N (7, 3))
APPEND FROM (this.filename) TYPE CSV
lcunion = unionid
lcclassid = classid
REPLACE empid WITH ALLTRIM(empid),;
jobid WITH ALLTRIM(jobid),;
trackid WITH ALLTRIM(STRTRAN(trackid, '-', ' ')),;
workdate WITH STRTRAN(workdate, '-', '/'),;
classid WITH ALLTRIM(classid),;
glid WITH ALLTRIM('578'),;
craftid WITH ALLTRIM('ELE'),;
wcid WITH ALLTRIM(wcid),;
unionid WITH ALLTRIM(unionid),;
hoursr WITH(hoursr),;
rater WITH(rater) ALL
I need to be able to get the payrate from a specific lcunion and lcclass value placed in rater while it is looping over the csv file.
Ex:
REPLACE empid WITH ALLTRIM(empid),;
jobid WITH ALLTRIM(jobid),;
trackid WITH ALLTRIM(STRTRAN(trackid, '-', ' ')),;
workdate WITH STRTRAN(workdate, '-', '/'),;
classid WITH ALLTRIM(classid),;
glid WITH ALLTRIM('541'),;
craftid WITH ALLTRIM('PTR'),;
wcid WITH ALLTRIM(wcid),;
unionid WITH ALLTRIM(unionid),;
hoursr WITH(hoursr),;
rater WITH(SELECT Payrate FROM unclass WHERE Unionid = m.lcunion AND id = m.lcclassid) ALL
I realize this is not allowed here for example only.
Thank you in advance!
LOCAL lcunion, lcclassid
CREATE CURSOR Tsheets (username C (45),;
empid C (6),;
fname C (45),;
lname C (45),;
num C (45),;
group C (45),;
workdate C (10),;
day C (3),;
start C (45),;
end C (45),;
timezone C (2),;
hoursr N (6, 2),;
jobname C (45),;
trackid C (4),;
classid C (2),;
wcid C (2),;
jobid C (45),;
unionid C (2),;
location C (45),;
notes C (254),;
approved C (45),;
glid C (3),;
craftid C (3),;
rater N (7, 3))
APPEND FROM (this.filename) TYPE CSV
lcunion = unionid
lcclassid = classid
REPLACE empid WITH ALLTRIM(empid),;
jobid WITH ALLTRIM(jobid),;
trackid WITH ALLTRIM(STRTRAN(trackid, '-', ' ')),;
workdate WITH STRTRAN(workdate, '-', '/'),;
classid WITH ALLTRIM(classid),;
glid WITH ALLTRIM('578'),;
craftid WITH ALLTRIM('ELE'),;
wcid WITH ALLTRIM(wcid),;
unionid WITH ALLTRIM(unionid),;
hoursr WITH(hoursr),;
rater WITH(rater) ALL
I need to be able to get the payrate from a specific lcunion and lcclass value placed in rater while it is looping over the csv file.
Ex:
REPLACE empid WITH ALLTRIM(empid),;
jobid WITH ALLTRIM(jobid),;
trackid WITH ALLTRIM(STRTRAN(trackid, '-', ' ')),;
workdate WITH STRTRAN(workdate, '-', '/'),;
classid WITH ALLTRIM(classid),;
glid WITH ALLTRIM('541'),;
craftid WITH ALLTRIM('PTR'),;
wcid WITH ALLTRIM(wcid),;
unionid WITH ALLTRIM(unionid),;
hoursr WITH(hoursr),;
rater WITH(SELECT Payrate FROM unclass WHERE Unionid = m.lcunion AND id = m.lcclassid) ALL
I realize this is not allowed here for example only.
Thank you in advance!