Not quite that simple Carl. tblAllocation has 60 period fields from P1 to
P60. If there is an allocation in Feb 07 for example, tblPeriod tells me Feb
07 is assigned P2. I put an allocation in tblAllocation field P2.
Are you saying there are actually 60 period fields (P1 - P60) in
tblAllocation? If so, you need to rethink your table design. There should be
a single Period field (which will contain a string such as "P1" or "P60"),
linked to the corresponding PeriodID field in tblPeriod. That way, if you
ever need to add additional periods you can do so without having to change
the table design.
If for some reason you can't change your table design, I can't offer any
other suggestions.
Carl Rapson
> Not quite that simple Carl. tblAllocation has 60 period fields from P1 to
> P60. If there is an allocation in Feb 07 for example, tblPeriod tells me
[quoted text clipped - 35 lines]
>> > table
>> > header?
NevilleT - 01 May 2007 00:34 GMT
Hi Carl
Against all the rules of normalisation, I created 60 period fields. Strange
as it might seem, I had to do it for performance reasons. I initially did
use a normalised approach but performance was poor and I rewrote it to use
single records for 60 periods. Reduced screen display time from around 20 to
30 seconds down to less than 5 seconds.
I have overcome the issue by actually using VBA to create the SQL string.
It took a bit to get it working but I now create the SQL statement, and save
it as a querydef. I run the query and output it to Excel then delete the
query. Bit tedious but it gets the job done. Thanks for your help.
> Are you saying there are actually 60 period fields (P1 - P60) in
> tblAllocation? If so, you need to rethink your table design. There should be
[quoted text clipped - 47 lines]
> >> > table
> >> > header?