Hi, any ideas on the following appreciated, thanks.
background info:
I have one database (adminDB) that needs to gather data from 7 identicle databases(subDBs). My plan is to import query output from each of the subDBs as tables into the adminDB
so far this works to an extent
' delete exisiting tables if there
DoCmd.RunSavedImportExport "db1Stats" ' runs various queries in db1
DoCmd.Rename "DB1AttNos", acTable, "Ann Rep - Attendance Nos"
... 'rename all other tables
however a several of the queries in the saved import have parameter (from and to dates - example below) and I currently have to type in the same info multiple times.
SELECT DISTINCTROW AttenanceGroups.attendanceType, Sum([Let Bookings].AttNosAdult) AS [Sum Of AttNosAdult], Sum([Let Bookings].AttNosYouth) AS [Sum Of AttNosYouth], Sum([Let Bookings].AttNosChildren) AS [Sum Of AttNosChildren], Sum([Let Bookings].AttNosPre5) AS [Sum Of AttNosPre5], Count(*) AS [Count Of Let Bookings]
FROM AttenanceGroups INNER JOIN [Let Bookings] ON AttenanceGroups.[ID] = [Let Bookings].[Attendance Type]
WHERE ((([Let Bookings].bookDate)>=[Start Date:] And ([Let Bookings].bookDate)<=[End Date:]))
GROUP BY AttenanceGroups.attendanceType;
is there any way I can automate the passing of the from/ to dates to the queries (dates canbe lifted from a form for example)? The dates will be the same for each query.
- Angie