Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing query

Status
Not open for further replies.

theif68

Technical User
Apr 3, 2005
39
US
I have a database that will have a file imported multiple times in a day to be ran through some queries. This file will be different every time. I have a query that selects a random 25 records for a data dump but what is the easiest way to create a report that will change with the new fields each time...

Query:

SELECT TOP 25 tblImport.*
FROM tblImport
WHERE randomizer()=0
ORDER BY rnd(isnull([tblImport].[ID])*0+1);
 
How are ya theif68 . . .

Whats wrong with seting the [blue]RecodSource[/blue] of the Report to the query name? . . . or use the [blue]Report Wizard[/blue] selecting the query . . .

Calvin.gif
See Ya! . . . . . .
 
Well I have been using the Report Wizard to create it each time, but would like to cut down on time , and make this automatic if possible.

 
Hi!

If I understand you correctly the import will result in a table that has different fields each time? If so then you can only do this using VBA and even then it will be difficult. Do some fields stay the same? and will the number of fields always be the same?



Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Is it possible for you to keep the field names for tblImport the same? Like "Field1", "Field2",..."Field10". That way, you can create your report once and use it for each import.
 
The field Names and Number of Fields change every time. I am also using the table to print a field listing for a report as well so keeping the names Field 1 through whatever might not work the best...

Thanks again guys,
might just have to suck it up..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top