June 30, 2009 at 3:00 pm
First table structre (call this table1) looks something like this,
3 columns
date, errors, employeeid
5/27/ 5 5
5/26/ 32 31
Second table structure (call this table2) looks something like this
5 columns
errorid, errordate, iserror, employeeid, notes
1 6/23 1 5 'blabla '
Now here is the task:
In table1, employeeid 5 made 5 errors on date 5/27, I need to enter the errors in table2 five times for that one date 5/27. Just like I need to enter the 32 errors made by employeeid 31 on 5/26 into table 2 thirty two times. What is the best way to go about this please? Its a tricky one and any help will be appreciated. Thanks
Note: table1 has over a thousand records
June 30, 2009 at 3:03 pm
Are you entering any values into the Notes column during this process?
June 30, 2009 at 3:05 pm
Not at all, that is left empty
June 30, 2009 at 3:10 pm
Its empty
June 30, 2009 at 3:34 pm
Give the attached code a try. You need the code in both files.
June 30, 2009 at 3:43 pm
Thanks, Ill try both codes and get back to you shortly!
June 30, 2009 at 4:59 pm
I tried both codes and with a little tweaking to fit my environment, it worked perfectly. You are a genius and I appreciate your help. The UDF also showed me how to use the abs function properly. Thanks again for the help!!
June 30, 2009 at 10:29 pm
The UDF is a Dynamic Tally table. Take the time to read the second to last article I reference below in my signature block regarding Tally tables. You will find them extremely useful.
July 1, 2009 at 6:03 am
Hi,
You mean,
At Table1
Insert into Table1(empID,ErrorCount,ErrorDate) Values(1,5,'27-05-2009')
At Table2
5 new rows for empID 1
eg.
Insert Into Table2(ErrorID,ErrorDate,IsError,EmpID,Notes) Values
(1,'27-05-2009',1,1,'error 1')
Insert Into Table2(ErrorID,ErrorDate,IsError,EmpID,Notes) Values
(2,'27-05-2009',1,1,'error 2')
Insert Into Table2(ErrorID,ErrorDate,IsError,EmpID,Notes) Values
(3,'27-05-2009',1,1,'error 3')
Insert Into Table2(ErrorID,ErrorDate,IsError,EmpID,Notes) Values
(4,'27-05-2009',1,1,'error 4')
Insert Into Table2(ErrorID,ErrorDate,IsError,EmpID,Notes) Values
(5,'27-05-2009',1,1,'error 5')
Did you this type of functionality??
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply