query by code gives different records

R

Richard Choate

When I run my code with the SQL below, it gives me fewer records and some
repeated records within the set than if I use that exact same SQL in a
standard select query. I literally copied the SQL you see here and pasted it
in a query and got vastly different results (400 fewer records and some
records were repeated 15 or 20 times). Does anybody have a clue what could
be happening?

mySQL3 = "SELECT tblHistory.EID, EmpBasic.FullName, tblDate, Period, [Gross
Pay], " & _
"FICABase, [401K], Medical, Medicare, DefBen, Travel, " & _
"Overtime, CumWages, CumFICA, CumMedicare, [FICABase]+[Medicare] " & _
"AS Taxes, BonusType FROM EmpBasic INNER JOIN tblHistory ON EmpBasic.EID =
tblHistory.EID;"

Thanks,
Richard Choate, CPA
 
R

Richard Choate

Solved. My error. I have a backup copy of the db that exists in the same
directory as the one referred to in my code. The offending query was feeding
off of the wrong copy of the mdb, therefore giving the wrong answers.

My apologies for bothering the group on this.

Richard Choate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top