Viewing 10 posts - 1 through 10 (of 10 total)
For now I used some File System tasks to copy the file into a working copy with a file name that is set in the project parameter. So the...
April 15, 2015 at 1:51 pm
Here is my solution.
;with cte_DateFill as (
SELECT xD.[Date]
,xpa.ID
,xpa.company
FROM #PosDates xPA
JOIN @Date xD ON xD.DATE BETWEEN xPA.START_DATEAND ISNULL(xPA.END_DATE, GETDATE())
GROUP BY xd.[Date], xPA.ID, xPA.COMPANY
)
,cte_Groups as (
SELECT ID
,Company
,[Date]
,DateGroup = DATEADD(dd, - ROW_NUMBER() OVER...
January 15, 2014 at 9:12 am
I hope you used the CROSS APPLY VALUES approach to UNPIVOT.
You can read about it in the first article in my signature links.
I did do unpivot. I'll check out...
January 14, 2014 at 8:57 pm
WOOHOO! That did it!
I unpivoted the start & end date into one date column. (had to group them to eliminate duplicates for some records) I joined...
January 14, 2014 at 3:41 pm
Luis Cazares (1/14/2014)
Does this article help you?
That may do it, but I'll have to fill in all the days in between the start & end. Then plug those dates...
January 14, 2014 at 1:44 pm
Here it is.
CREATE TABLE #POSDATES (
IDINT
COMPANYTINYINT
POS_IDTINYINT
[START_DATE]DATE
END_DATEDATE
)
INSERT INTO [#POSDATES]([ID],[COMPANY],[POS_ID],[START_DATE],[END_DATE])
VALUES
(333,1,1,CAST('20110902' as DATE),CAST('20120831' as DATE)),
(333,1,1,CAST('20120901' as DATE),CAST('20120910' as DATE)),
(333,1,1,CAST('20120911' as DATE),CAST('20120911' as DATE)),
(333,1,1,CAST('20120912' as DATE),CAST('20130106' as DATE)),
(333,1,1,CAST('20130901' as DATE),NULL),
(999,1,1,CAST('20110902' as DATE),CAST('20120909' as DATE)),
(999,1,1,CAST('20120910'...
January 14, 2014 at 11:44 am
Awesome! Thanks Gazareth!
Now that I've read your post I vaguely remember hearing that invoke-sqlcmd returns the table and sqlcmd returns a string. There's no way I...
June 25, 2013 at 10:01 am
This is the closest I've come to finding a topic on what I'm trying to do. I'm setting a PS variable equal to the results from a query that...
June 24, 2013 at 9:50 pm
I'm running into the same behavior. SSMS 2012 intellisense won't do anything when I'm connected to SQL boxes that are hosted offsite. It won't even show me variables that...
June 11, 2013 at 11:11 am
I did try the IsNothing. I found two forms of that, the one you posted and another that looked like this:
...
July 13, 2011 at 2:55 pm
Viewing 10 posts - 1 through 10 (of 10 total)