cs_source (2/28/2015)
I have a table that has hotel guests and their start stay date and end stay date, i would like to insert into a new table the original information + add all days in between.CREATE TABLE hotel_guests
(
[guest_name] [varchar](25) NULL,
[start_date] [date] NULL,
[end_date] [date] NULL,
[comment] [varchar](255) NULL
)
CREATE TABLE hotel_daily_visit
(
[guest_name] [varchar](25) NULL,
[effective_date] [date] NULL,
[start_date] [date] NULL,
[end_date] [date] NULL,
[comment] [varchar](255) NULL
)
INSERT INTO hotel_guests (guest_name,start_date,end_date)
VALUES ('jim','2015-02-01','2015-02-15','cleaning');
All help is much appreciated!
My question now would be, why do you want to expand the data like this? What purpose will it be used for. I ask because it may be totally unnecessary to perform this data duplication.
--Jeff Moden
Change is inevitable... Change for the better is not.