Viewing 15 posts - 2,176 through 2,190 (of 3,738 total)
Good question.
I'm just trying to find a way to get it done.
It seems that I have two options, create an Inline View or CTE to get it done in T-SQL...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 4, 2011 at 2:46 pm
I squeeze in some of the columns and abbreviated the column names to make this readable but this is what the result looks like from the output of the Temp...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 4, 2011 at 2:11 pm
J Livingston SQL (11/4/2011)
what do you believe to be the problem.?.....assume there is one hence your post?have you any set up scripts and sample data?
regards
I can understand why you want...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 4, 2011 at 1:48 pm
Lynn Pettis (11/2/2011)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 3, 2011 at 12:31 pm
Thanks Kramaswamy! 😎
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 3, 2011 at 12:29 pm
kramaswamy (11/3/2011)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 3, 2011 at 9:46 am
As a workaround could I remove a generic static heading and insert the dynamic column headings (Previous Year, Previous Month, Previous Weeks) based on the current Date using a Script...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 3:43 pm
OK, I agree on the Date range.
In the past I would concatenate the Date with the Time '23:59:59.123' and use the Between Operator because of the large number of records.
I...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 3:35 pm
Drew,
I do not want to miss any records.
I have already calculated the First Dates of the Current, Previous and Next Months but I thought that the BETWEEN OPERATOR would...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 2:38 pm
Lynn Pettis (11/2/2011)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 2:25 pm
Sample Output.
Ran before End of Month (Oct).
Column has a 1 in each record that the lead generated into a sale.
Account Affinity20102011 YTD OCT 2011 MTDSEP 2011 AUG 2011 WK...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 1:39 pm
Lynn Pettis (11/2/2011)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 1:31 pm
I thought that after I posted the question.
Makes sense.
Thanks for your help!
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 10:23 am
The boss does not want to go with the Excel MAcros.
Back to using SSIS.
The following generates the column headers for the first two aggregates:
SELECT DATEPART(YEAR,DATEADD(year,-1,GETDATE())) AS Year,
CAST(DATEPART(YEAR,DATEADD(year,0,GETDATE())) AS VARCHAR(35)) +...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 9:51 am
kramaswamy (11/1/2011)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 2, 2011 at 8:44 am
Viewing 15 posts - 2,176 through 2,190 (of 3,738 total)