I need to create a report based on some regular tables in my DB and a couple of answer tables that are created by running queries just before running the report. I made the queries in the standard QBE mode but can't figure out any way to get it to make fields in the answer table to be keys. I want a composite key made from the first two fields in the answer table.
Of course I can go and restructure the answer table after running the query, and add the keys, but that is no good. I need to automate this so the answer table is generated and then used in the report.
Is there any way to tell QBE to make an answer table field be a key?
The first way is to create a script and automate the process. The script will of course go in and restructure the table.
The second way (easier) is to use an append query and create the table permanently first. "Report_Table" Then create a query that does not create an answer table but inserts records into the report table. Which will already be keyed.
By the way, do you know that you can create the report based on the Query instead of the answer table which would allow you some other flexibility?
Thanks. That sent me in the right direction for what I needed. I read up on doing queries with delete and insert and ended up running 2 queries to build up the results I needed and then a query to delete the current contents of the final table and another query to insert the new data into the final table.
There may have been an easier way to do it, but I got that done in an hour and I had spent days banging my head against the wall before posting the original message, so for me it was a quick fix. I couldn't get the insert to work directly from the first pair of queries because there were a number of calculated fields and Paradox wouldn't let me do inserts with "calc" in them.