View Full Version : Temp Table problem


GaryPanic
10-02-2006, 08:52 AM
Hellooo
Hi gurus
I have a smallish problem
I have two tables that I need to join togther - normally no problem

I have one table with 1 event on it- easy
however if I have more than 1 event on it I have another table that opens up and I add multiple evnets to it
main id number 12345 with 1 event on it and
23456 may have 20 events on it
on my other table (with multiples on it) i have this autonumbered (this is great unique id - now i need to make a temp table to include boths sets of data in one file

1 event table - easy
multi event tabel I want it to get the main refernce fromt he first table (using 23456 as the example) and have it list these in the table - main refer 23456-multi table unique ref number 23456-1 , 23456-2

so my table should have
12345
23456-1
23456-2
23456-etc

I have been using append qry to make tables - any pointers would be great

GP

GaryPanic
10-02-2006, 01:08 PM
some how this has disapeared

Pat Hartman
10-06-2006, 10:00 AM
It is rare that you need temp tables at all. Rather than cluttering up your database with unnecessary objects and increasing the frequency of compacting, just base one query off another. Instead of choosing a table, you can choose another query as a source in your query.

GaryPanic
10-09-2006, 08:00 AM
Solved this - _ for those interested - what i did in the end was to recreate an extra field and in the first qry have this as space id number so " " 12345
whcih change the format of the temp field to text on the omake table I added an extra field which was main ref + " " +unique refernce for this 12345"" 45644 subrecord - probably not the best way of doing it but - its works and its simple -


Thanks Pat - but i do need temp table as who I need to report on varies
i have a section of people about 10 and on one selection only 4 people get on another 3 and on another 2 others all 10 - I need to mix and match what- how and who gets this info (by contract) - and i have the temp table empty once i exit - so not such and issue about the file size

But your point is well noted ( and I have used this in the rest of my build ) thanks - (at least I know I going down the right route for the rest of my build ) all imput is alway welcome
cheers

Pat Hartman
10-09-2006, 01:55 PM
That is what parameter queries are for. They allow you to specify at runtime, how to select the data you need.