I have the following problem in a Database using Access 2007 as front end and SQL2005 as back-end.
In Table A I have the following data structure
Table A
ID Date Supplier_ID
1 10/22/2009 1
2 10/23/2009 1
3 10/24/2009 2
4 10/25/2009 2
5 10/26/2009 1
I need to merge values that have consecutive dates and the same Supplier_ID, increment a new column (Days) for each of these consecutive records and them write the data into Table B, so that I have
Table B
ID Date Supplier_ID Days
1 10/22/2009 1 2
2 10/24/2009 2 2
3 10/26/2009 1 1
Only consecutive days should be merged. Hence ID 5 in table A has is added to table B as a new record. It's been some time since I've been working with Access VBA and wondered what the right approach to this would be.