multiple records with same results

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am calculating a percentage on a field called
"sum_of_sum_of_count_of_fieldname" and I get 1014 records with the exact same
data, when I only want one line with the percentage. I tried to eliminate
the sum_of_sum_of_count field, but that's the only way I could get the right
number to do the calculation.

Any comments/suggestions??

Thank you in advance,
Mary
 
Here it is - not very pretty:
SELECT [stat-Alc 4 sum dec].[SumOfSumOfcountofCLIENT_ID]/[stat-Alc 2 sum
n].[SumofCountofClient_ID] AS [Percent decr], [stat-Alc 4 sum
dec].SumOfSumOfCountOfCLIENT_ID, [stat-Alc sum
maint].[sumofcountofclient_id]/[stat-Alc 2 sum n].[SumofCountofClient_ID] AS
[Percent maint], [stat-Alc sum maint].SumOfCountOfCLIENT_ID, [stat-Alc 2 sum
n].SumOfCountOfCLIENT_ID
FROM [stat-Alc 1], [stat-Alc 2 sum n], [stat-Alc 3 count dec], [stat-Alc 4
sum dec], [stat-Alc sum maint];
Thank you Jerry
m
 
Sorry that it took me so long, but I was on a mini-vacation.

The problem is that you have a Cartesian join. You have nothing that links
the tables together with joins in the Where clause or Join statements between
the tables. Look at the query in the QBE window. There aren't any lines
between the tables I wager.

--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Mary said:
Here it is - not very pretty:
SELECT [stat-Alc 4 sum dec].[SumOfSumOfcountofCLIENT_ID]/[stat-Alc 2 sum
n].[SumofCountofClient_ID] AS [Percent decr], [stat-Alc 4 sum
dec].SumOfSumOfCountOfCLIENT_ID, [stat-Alc sum
maint].[sumofcountofclient_id]/[stat-Alc 2 sum n].[SumofCountofClient_ID] AS
[Percent maint], [stat-Alc sum maint].SumOfCountOfCLIENT_ID, [stat-Alc 2 sum
n].SumOfCountOfCLIENT_ID
FROM [stat-Alc 1], [stat-Alc 2 sum n], [stat-Alc 3 count dec], [stat-Alc 4
sum dec], [stat-Alc sum maint];
Thank you Jerry
m

Jerry Whittle said:
Please post the entire SQL statement.
 
Back
Top