S
Steven Cheng
below is the union query statement that had been built. up until last week,
it had been working, however, for some reason, it is not cooperating:
SELECT A.EMPIDValidation AS EMPLOYEE, [Period ending] AS PEREND, "WEEK" AS
TIMECARD, 2 AS CATEGORY, A.ecode AS EARNDED, "" AS UNI, A.weekending AS
EARDEDDATE, A.Store AS GLSEG1, format(A.Regular,"0.00") AS HOURS, "TRUE" AS
WEEKLYNTRY, GL AS EXPACCT
FROM qryTimeCard_Stage2_Regular AS A WHERE (A.Regular<>0) AND GL<>""
UNION SELECT B.EMPIDValidation AS EMPLOYEE, [Period ending] AS PEREND,
"WEEK" AS TIMECARD, 2 AS Category, "OT" AS EARNDED, "" as UNI, B.weekending
AS EARDEDDATE, B.Store AS GLSEG1, format(B.OTHours_V,"0.00") AS HOURS, "TRUE"
AS WEEKLYNTRY, GL as EXPACCT FROM qryTimeCard_Stage2_OT AS B WHERE
(B.OTHours_V<>0);
I have tried to run them the two tables independently and they are okay.
nothing has changed for the data structure. the only funny point is that it
is creating a databse1 file in the same folder. Error message is pointing at
the fact that the recordset is readonly and thus not allowing for it to be
run (invalid operation).
it had been working, however, for some reason, it is not cooperating:
SELECT A.EMPIDValidation AS EMPLOYEE, [Period ending] AS PEREND, "WEEK" AS
TIMECARD, 2 AS CATEGORY, A.ecode AS EARNDED, "" AS UNI, A.weekending AS
EARDEDDATE, A.Store AS GLSEG1, format(A.Regular,"0.00") AS HOURS, "TRUE" AS
WEEKLYNTRY, GL AS EXPACCT
FROM qryTimeCard_Stage2_Regular AS A WHERE (A.Regular<>0) AND GL<>""
UNION SELECT B.EMPIDValidation AS EMPLOYEE, [Period ending] AS PEREND,
"WEEK" AS TIMECARD, 2 AS Category, "OT" AS EARNDED, "" as UNI, B.weekending
AS EARDEDDATE, B.Store AS GLSEG1, format(B.OTHours_V,"0.00") AS HOURS, "TRUE"
AS WEEKLYNTRY, GL as EXPACCT FROM qryTimeCard_Stage2_OT AS B WHERE
(B.OTHours_V<>0);
I have tried to run them the two tables independently and they are okay.
nothing has changed for the data structure. the only funny point is that it
is creating a databse1 file in the same folder. Error message is pointing at
the fact that the recordset is readonly and thus not allowing for it to be
run (invalid operation).