Viewing 5 posts - 1 through 6 (of 6 total)
Steve,
Thank you SO much for the assistance. I didn't think about removing the extraneous Minutes and seconds. I adjusted the code to pull from my actual data...
June 19, 2015 at 9:29 am
This is probably a mess, but it does the trick:
declare @start datetime
declare @end datetime
set @start = GetDate()
set @end = dateadd(hour,72,GetDate())
while @start < dateadd(day,30,getdate()) begin
Insert Into tempdb.dbo.DateRanges
...
June 18, 2015 at 4:42 pm
Steve,
Thanks for the follow up. I agree, the windowed functions are nice, but not quite as robust as I had hoped. As for the datetime resolution, I...
June 18, 2015 at 12:03 pm
USE [tempdb]
CREATE TABLE [dbo].[MigrationBreakdown](
[DepartDateTime] [datetime] NOT NULL,
[ZoneMovement] [varchar](50) NOT NULL
) ON [PRIMARY]
INSERT [dbo].[MigrationBreakdown] ([DepartDateTime], [ZoneMovement]) VALUES (CAST(N'2015-06-26 14:00:00.000' AS DateTime), N'6 to 4')
INSERT [dbo].[MigrationBreakdown] ([DepartDateTime], [ZoneMovement]) VALUES (CAST(N'2015-06-26 14:00:00.000' AS...
June 18, 2015 at 11:04 am
Thanks for the suggestions. You are correct, looking back my sample data does not contain enough to illustrate what I am looking for. Let me see...
June 18, 2015 at 9:50 am
Viewing 5 posts - 1 through 6 (of 6 total)