472,325 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

Append Query Random Failure

Greetings,

It appears that an Append Query I run in Access XP is randomly failing
to append a field.

I have payroll data being entered into a payroll database. This data
is exported daily to two csv files. (One for updated data, and the
other for unupdated data.)

The CSV files are attached to my Jobcosting database. After the CSV
files are updated, I use an append query to put that data in a table.
This is my standard billing data. However, if Futa/Suta limits have
not been met on an individual I recoup the cost of the Futa/Suta. So,
I use another append query to append the data in that table to itself
if limits have not been met (as shown in another table.) This is where
the process is breaking down.

Once all data is in the transient table, is use another append query to
append all that data, along with the billing rates in my permanent
Jobcost table.

The problem is that while appending the Futa/Suta data, the append
query fails to post the craft on random records. I can't detect a
pattern. It doesn't appear to be related to the name, employee number,
or craft. It just skips roughly 40% of the crafts. SQL is posted
below.

AppendQueryFutaSuta

INSERT INTO [LABOR IMPORT] ( CATAGORY, [JOB NUMBER], [ACTIVITY NUMBER],
[DAY CODE], [DATE], [WEEK ENDING], SSAN, [EMPLOYEE NUMBER], [EMPLOYEE
NAME], CRAFT, [REG HRS], [OVT HRS], [DBL HRS] )
SELECT DISTINCTROW "FutaSuta" AS Expr1, [LABOR IMPORT].[JOB NUMBER],
[LABOR IMPORT].[ACTIVITY NUMBER], [LABOR IMPORT].[DAY CODE], [LABOR
IMPORT].DATE, [LABOR IMPORT].[WEEK ENDING], [LABOR IMPORT].SSAN, [LABOR
IMPORT].[EMPLOYEE NUMBER], [LABOR IMPORT].[EMPLOYEE NAME], [LABOR
IMPORT].CRAFT, [LABOR IMPORT].[REG HRS], [LABOR IMPORT].[OVT HRS],
[LABOR IMPORT].[DBL HRS]
FROM ([LABOR IMPORT] INNER JOIN WeeklyEmployees ON [LABOR
IMPORT].[EMPLOYEE NUMBER] = WeeklyEmployees.[EMPLOYEE NUMBER]) INNER
JOIN tblJobs ON ([LABOR IMPORT].[ACTIVITY NUMBER] = tblJobs.[ACTIVITY
#]) AND ([LABOR IMPORT].[JOB NUMBER] = tblJobs.[JOB #])
WHERE (((WeeklyEmployees.Futa)=Yes) AND (([LABOR
IMPORT].CATAGORY)="A-LABOR") AND ((tblJobs.[SUTA and FUTA])=Yes));

and the query that appends to my JOBCOST table and adds the rates
according to the craft (which if the craft is null, so is the rate.):

INSERT INTO JOBCOST ( CATAGORY, [JOB NUMBER], [ACTIVITY NUMBER], [DAY
CODE], [DATE], [WEEK ENDING], SSAN, [FIELD 1], [FIELD 2], [FIELD 3],
[COST 1], [COST 2], [COST 3], [REG BILL RATE], [OVT BILL RATE], [DBL
BILL RATE], ADDENDUM, TRANSFER, REVISION, [MONTHLY BILL RATE],
[POSITION CODE] )
SELECT DISTINCTROW [LABOR IMPORT].CATAGORY, [LABOR IMPORT].[JOB
NUMBER], [LABOR IMPORT].[ACTIVITY NUMBER], [LABOR IMPORT].[DAY CODE],
[LABOR IMPORT].DATE, [LABOR IMPORT].[WEEK ENDING], [LABOR IMPORT].SSAN,
[LABOR IMPORT].[EMPLOYEE NUMBER], [LABOR IMPORT].[EMPLOYEE NAME],
[LABOR IMPORT].CRAFT, [LABOR IMPORT].[REG HRS], [LABOR IMPORT].[OVT
HRS], [LABOR IMPORT].[DBL HRS], DLookUp("[COST 1]","rates_" &
[tblJobs]![RATE SCHEDULE],"[FIELD 3] = '" & [CRAFT] & "' AND [RATE
CATAGORY] = '" & [LABOR IMPORT]![CATAGORY] & "'") AS Expr1,
DLookUp("[COST 2]","rates_" & [tblJobs]![RATE SCHEDULE],"[FIELD 3] = '"
& [CRAFT] & "' AND [RATE CATAGORY] = '" & [LABOR IMPORT]![CATAGORY] &
"'") AS Expr2, DLookUp("[COST 3]","rates_" & [tblJobs]![RATE
SCHEDULE],"[FIELD 3] = '" & [CRAFT] & "' AND [RATE CATAGORY] = '" &
[LABOR IMPORT]![CATAGORY] & "'") AS Expr3, No AS Expr4, No AS Expr5, 0
AS Expr6, DLookUp("[COST 4]","rates_" & [tblJobs]![RATE
SCHEDULE],"[FIELD 3] = '" & [CRAFT] & "' AND [RATE CATAGORY] = '" &
[LABOR IMPORT]![CATAGORY] & "'") AS Expr7, DLookUp("[FIELD 2]","rates_"
& [tblJobs]![RATE SCHEDULE],"[FIELD 3] = '" & [CRAFT] & "'") AS Expr8
FROM [LABOR IMPORT] INNER JOIN tblJobs ON ([LABOR IMPORT].[JOB NUMBER]
= tblJobs.[JOB #]) AND ([LABOR IMPORT].[ACTIVITY NUMBER] =
tblJobs.[ACTIVITY #]);

This has to be something simple, but I just can't see it.
Any and all help is much appreciated.

David M. Barger

Nov 13 '05 #1
1 2373

Please disregard my previous question.

As it turns out, the problem is not with my import routine. The
problem lies with my manual input form (a problem I knew about and
solved earlier today.) Unfortunately, the time keeper from the jobsite
in question not only imported some of the time, she also input some of
it manually. Only supervision is routinely input manually, so when I
saw nulls on non-supervision personnel I naturally assumed that an
error was occurring in the import scheme.

I have spent all bloody day looking at those two queries trying to
figure out where it could be going wrong. It would have been nice if
she had mentioned that she hadn't imported all of the records!

My apologies for any inconveniences caused by my question.
Many thank for your consideration.

David M. Barger

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: M. Clift | last post by:
Hi All, I have tried to come up with a way to do this myself and all I end up with is very long code. What I have is a say item1, item4,...
1
by: Randy K | last post by:
I have a table with some 35000 records and I need some help sorting it out. The goal is to get counts of failures modes oraganized by serial...
2
by: Danny | last post by:
I want to extract a subset of fields from one table into another the master table has many fields the subset has about half, but still many. Is...
1
by: Aaron | last post by:
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i...
1
by: Kurt | last post by:
For some reason I cannot use an append query to append records to a design master replication table that has the index key on a random Long...
3
by: ielamrani | last post by:
Hi, An append query is giving me the following error: qryPar can't append all the records in the append query qryPar set 0 field(s) to null due...
2
by: durgapur | last post by:
hi, i am trying to round off the value of a text field and then append it to a decimal field, but it's giving type conversion failure, below...
3
by: Francogrex | last post by:
Hello, I am new to C++, have some knowledge of programming in splus(statistics). I am trying to append values output by a loop (code below) into a...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.