Viewing 15 posts - 1,216 through 1,230 (of 2,171 total)
What you seem to need is a CROSSTAB/PIVOT like thisCREATE PROCEDURE dbo.VIEW_REPORTS
(
@BRC_START_DATE DATETIME,
@BRC_END_DATE DATETIME,
@Hild_Branch VARCHAR(50),
@REPORTSIZE INT,
@RPT_REPORT_NAME VARCHAR(10),
@USER_ID INT,
@ReportType_Code NVARCHAR(50)
)
AS
SET NOCOUNT ON
DECLARE @MonthFirstDate DATETIME
SET@MonthFirstDate = DATEADD(MONTH, DATEDIFF(MONTH, @BRC_END_DATE, '19000101'), '19000101')
SELECTb.BRC_BRANCH_CODE,
sum(case...
October 23, 2007 at 7:38 am
I also lack the oppurtunity to call the SP twice in a row.
I get an error "index already exists".
October 23, 2007 at 3:55 am
Change the anchor part to GROUP BY and add a COUNT for top level items.
Add a +1 in the recursive part.
October 23, 2007 at 12:24 am
Antonio (10/21/2007)
Hi,We want to create an Internet sealing system.
Do you really want to SEAL the Internet? 🙂
October 23, 2007 at 12:23 am
I think you are getting a tree hierarchy.
Just use a WHILE loop instead.
October 23, 2007 at 12:22 am
Jeff, excellent code but I think you should start using QUOTENAME function for those having brackets, spaces or even single quotes in their table/column names.
October 23, 2007 at 12:20 am
I think OLE/AdoDB has a "refresh" method that will try to get the parameters with datatype and direction for you.
October 18, 2007 at 2:24 am
Are you trying to collapse datetime ranges?
October 18, 2007 at 2:22 am
Not for me.
I have tested on all these and your code gives exact same sum.
SQL Server Express 2005 9.0.3186
SQL Server Enterprise 2000 8.00.818
SQL Server Standard 2000 8.00.818
SQL Server Enterprise 2000...
October 16, 2007 at 9:23 am
As other has said before me, FLOAT is just an approximation based on binary storage of the number.
See here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81849
Can't you just change the datatype to DECIMAL(20, 12) ?
October 16, 2007 at 2:37 am
HOW is shown at this blog
October 16, 2007 at 12:35 am
Strange that when a problem is URGENT, the original poster always finds time to post the problem statement on several different sites...
October 15, 2007 at 5:18 am
October 11, 2007 at 7:12 am
Are instead-of-triggers available in SQL Server 2000?
October 11, 2007 at 4:41 am
I know "date Zero" is 1899-12-30 in both Access AND VB6. Not 1899-12-31.
So you are off by two days.
October 11, 2007 at 4:19 am
Viewing 15 posts - 1,216 through 1,230 (of 2,171 total)