HestonJames
Programmer
Hello Guys,
I have a tables which looks somewhat like this:
CustomerTransaction
----------------------
CustomerTransaction_ID - Int - PK - Identity
Customer_ID - Int
Description - Varchar
TransactionDateTime - DateTime
What I want to do is given a datetime range and a customer_id INSERT records into the table which are the same as records one month prior to that range.
So, for instance if I'm given the following datetimes:
22/01/2008 08:00
28/01/2008 16:00
Customer_ID = 41
The I want it to SELECT all the records for that datetime range but -1 month (22/12/2007 08:00 - 28/12/2007 16:00) for that customer_id, and then INSERT them into the table but within the daterange above.
What's the best way to achieve this? If you have any questions guys then please let me know
Heston
I have a tables which looks somewhat like this:
CustomerTransaction
----------------------
CustomerTransaction_ID - Int - PK - Identity
Customer_ID - Int
Description - Varchar
TransactionDateTime - DateTime
What I want to do is given a datetime range and a customer_id INSERT records into the table which are the same as records one month prior to that range.
So, for instance if I'm given the following datetimes:
22/01/2008 08:00
28/01/2008 16:00
Customer_ID = 41
The I want it to SELECT all the records for that datetime range but -1 month (22/12/2007 08:00 - 28/12/2007 16:00) for that customer_id, and then INSERT them into the table but within the daterange above.
What's the best way to achieve this? If you have any questions guys then please let me know
Heston