query on linked tables

R

Randal

The following query produces different results each time it runs. It is
pulling data from linked .dbf files that were created in VFP. I have
changed the query from a summary to pull detail lines and it generates a
different number of records each time it runs. Data is not actually
changing.

It seems to me that there is probably an issue with the join. Any help is
appreciated.

SELECT Table1.flag1, Sum([Table2].amt1) AS SumOfamt1, Sum([Table2].amt2) AS
SumOfamt2, Sum([Table2].amt3) AS SumOfamt3, Sum([Table2].amt4) AS SumOfamt4,
Sum([Table2].amt5) AS SumOfamt5
FROM Table1 INNER JOIN Table2 ON (Table1.code_sub = [Table2].company_sb) AND
(Table1.code = [Table2].company)
WHERE (((Table1.flag2) Not Like "C"))
GROUP BY Table1.flag1;
 
R

Randal

Answer rec'd in another group - See below.

Hi Randal,
A year or so back, Arno had a similar problem (VFP)
and this was what corrected it:

**** QUOTE ******
- problem solved -

i found the problem in the odbc settings for visula foxpro databases. the
standard value for "BackgroundFetch" was set to "YES". when i set it to "NO"
all the results where ok!

i changed all the settings in the odbc-connection string but
"BackgroungFetch" was the one that solved the problem.

thank you for your help

arno
**** UNQUOTE ****
Randal said:
The following query produces different results each time it runs. It is
pulling data from linked .dbf files that were created in VFP. I have
changed the query from a summary to pull detail lines and it generates a
different number of records each time it runs. Data is not actually
changing.

It seems to me that there is probably an issue with the join. Any help is
appreciated.

SELECT Table1.flag1, Sum([Table2].amt1) AS SumOfamt1, Sum([Table2].amt2) AS
SumOfamt2, Sum([Table2].amt3) AS SumOfamt3, Sum([Table2].amt4) AS SumOfamt4,
Sum([Table2].amt5) AS SumOfamt5
FROM Table1 INNER JOIN Table2 ON (Table1.code_sub = [Table2].company_sb) AND
(Table1.code = [Table2].company)
WHERE (((Table1.flag2) Not Like "C"))
GROUP BY Table1.flag1;
 

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