Sorting numbers of Rows

k209310

Registered User.
Local time
Today, 17:40
Joined
Aug 14, 2002
Messages
184
I have an wakward little problem.

I have a tableand it has entries under the title of Totals. Each total is entered under a number eg 1, 2, 3. There will be either three of four entries for each total. Eg Total1 may have 3 entries and Total2 may have four entries.

Is it possible to seperate the entries between the entries with four and the entries with three records?

I hope this makes sense
 
With the structure you just described, not easily. But it is ALWAYS possible. The results just might not be very general.

You might wish to revisit the structure that you are using. Almost always, when you have a TOTAL1, TOTAL2, TOTAL3 grouping, you SHOULD have done it a different way. Now don't take this as being negative, but the structure you described APPEARS to have violated either first-normal form or second-normal form (I can NEVER remember which is which...) in terms of normalization.

What you wrote suggests that you have an item table that looks like

Table:
-- some primary key (or no key, maybe)
-- Item 1
-- Item 2
-- Item 3

etc.

This would naturally lead to sums that might be called Total1, Total2, Total3, ....

The corrected format might be;

Table:
-- some primary key (or no key...)
-- Item number
-- Item value

THEN you could write a Totals query that grouped by Item Number to get where you wanted to go.
 

Users who are viewing this thread

Back
Top Bottom