Hi,
I'm using Access 2007.
I have imported a table called 'January' and from this I need to update an existing table called 'TablesInfo' which needs to hold some details about the imported tables.
Fields needed are:
[NumRecords] total number of records in the imported table
[DateFrom] earliest date in the Arrival Time field of the imported table
[DateTo] latest date in the Arrival Time field of the imported table
I'm using VB from a command button at the moment to do this but I'm not sure what to use e.g. INSERT INTO or UPDATE or maybe I have to try a join?
Ok I have tested hard wiring in values and this works fine e.g.
-
DoCmd.RunSQL "INSERT INTO TablesInfo ([NumRecords], [DateFrom], [DateTo]) VALUES ('100', '01/01/2008', '31/01/2008');"
-
But i need to calculate them which brings up errors i.e.
-
DoCmd.RunSQL "INSERT INTO TablesInfo ([NumRecords], [DateFrom], [DateTo]) SELECT (COUNT (January.[Arrival Time]) AS Count, MIN (January.[Arrival Time]) AS Min, MAX (January.[Arrival Time]) AS Max) FROM January;"
-
Any help would be appreciated
Thanks,
Chris