January 31, 2012 at 12:45 pm
david.ostrander (1/31/2012)
You have helped me out so much Thank you... I can see how it all works now.
Thats what the community is for right ? 🙂
January 31, 2012 at 1:49 pm
Hi there again. I hate to bug you but I was hoping to pick your brain again on this topic.
We have an SSIS job that runs and pull data into this staging table which people connect too within excel.
On Fridays at 4:00 PM that data run is kept in the same table and not deleted.
What I'm looking to do is run the view but no include this time frame 2012-01-27 16:00:00 it is another column names PIT
ALTER VIEW [dbo].[BackLogLabor13Wks]
AS
SELECT *
FROM dbo.BacklogLabor
WHERE ([Schedule Week] >= CONVERT(CHAR(10), DATEADD(DD, - 7, GETDATE()), 121)) AND ([Schedule Week] < CONVERT(CHAR(10), DATEADD(DD, 91, GETDATE()), 121))
Thought to that?
thanks
D-
February 1, 2012 at 1:16 am
so you have another column called PIT which holds datetime values?
February 1, 2012 at 6:15 am
Yes that PIT time is generated when the SSIS job runs.
February 2, 2012 at 1:52 am
i suppose you could add this to the where clause
AND PIT != CONVERT(CHAR(10),GETDATE(),121) + '16:00:00'
This will check the PIT column and exclude the current day at 16:00. Remember though that if the job doesn't populate the column with that exact time (i.e adds some milliseconds) then this condition won't pass.
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply