Click here to Skip to main content
15,902,741 members
Home / Discussions / Database
   

Database

 
AnswerRe: Stored Procedures - Validating Variables Pin
DerekFL14-Sep-07 9:14
DerekFL14-Sep-07 9:14 
Questionstored procedure replace function problem Pin
soniasan13-Sep-07 1:08
soniasan13-Sep-07 1:08 
AnswerRe: stored procedure replace function problem Pin
Joe13-Sep-07 2:03
Joe13-Sep-07 2:03 
AnswerRe: stored procedure replace function problem Pin
andyharman13-Sep-07 7:16
professionalandyharman13-Sep-07 7:16 
GeneralRe: .. Pin
Pete O'Hanlon13-Sep-07 23:03
mvePete O'Hanlon13-Sep-07 23:03 
GeneralRe: .. Pin
Joe14-Sep-07 0:29
Joe14-Sep-07 0:29 
GeneralRe: .. Pin
Pete O'Hanlon14-Sep-07 1:35
mvePete O'Hanlon14-Sep-07 1:35 
QuestionSQL stored porcedures Pin
OS GIKEN12-Sep-07 22:26
OS GIKEN12-Sep-07 22:26 
AnswerRe: SQL stored porcedures Pin
Pete O'Hanlon12-Sep-07 22:54
mvePete O'Hanlon12-Sep-07 22:54 
AnswerRe: SQL stored porcedures Pin
Frank Kerrigan13-Sep-07 6:11
Frank Kerrigan13-Sep-07 6:11 
AnswerRe: SQL stored porcedures Pin
Paul Conrad14-Sep-07 19:20
professionalPaul Conrad14-Sep-07 19:20 
QuestionQuery not returning distinct value Pin
miniThomas12-Sep-07 19:35
miniThomas12-Sep-07 19:35 
AnswerRe: Query not returning distinct value Pin
ritu432112-Sep-07 20:13
ritu432112-Sep-07 20:13 
GeneralRe: Query not returning distinct value Pin
/randz12-Sep-07 23:25
/randz12-Sep-07 23:25 
AnswerRe: Query not returning distinct value Pin
Michael Potter13-Sep-07 4:46
Michael Potter13-Sep-07 4:46 
GeneralRe: Query not returning distinct value Pin
Frank Kerrigan13-Sep-07 6:15
Frank Kerrigan13-Sep-07 6:15 
QuestionTrying to extract data from a single table Pin
Skanless12-Sep-07 8:18
Skanless12-Sep-07 8:18 
AnswerRe: Trying to extract data from a single table Pin
andyharman13-Sep-07 2:32
professionalandyharman13-Sep-07 2:32 
GeneralRe: Trying to extract data from a single table Pin
Skanless13-Sep-07 5:46
Skanless13-Sep-07 5:46 
GeneralRe: Trying to extract data from a single table Pin
Skanless13-Sep-07 5:54
Skanless13-Sep-07 5:54 
GeneralRe: Trying to extract data from a single table Pin
andyharman13-Sep-07 6:45
professionalandyharman13-Sep-07 6:45 
GeneralRe: Trying to extract data from a single table Pin
Skanless13-Sep-07 8:00
Skanless13-Sep-07 8:00 
Dude you are a Genius. I modified the script a but and it worked like a baby. Thnks dude.. I owe u a beer.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[sp_MS_IssuesReport_Num2](@PeriodName varchar(50), @BeginningDate datetime, @EndDate datetime)AS
BEGIN

SELECT dbo.RPT_GetPeriod(@PeriodName, A.PeriodDate) AS Period,
SUM(A.IssueReceived) AS IssuesReceived,
SUM(A.IssueClosed) AS IssuesClosed
FROM(
SELECT CreateDate AS PeriodDate,
1 AS IssueReceived,
0 AS IssueClosed
FROM Ms_threads
WHERE CreateDate BETWEEN @BeginningDate and @EndDate
UNION ALL
SELECT StatusDate AS PeriodDate,
0 AS IssueReceived,
dbo.RPT_IsInquiryCompleted(CurrentStatusID) AS IssueClosed
FROM Ms_threads
WHERE StatusDate BETWEEN @BeginningDate and @EndDate
) A
GROUP BY dbo.RPT_GetPeriod(@PeriodName, A.PeriodDate) -- Added the date floor function.
ORDER BY dbo.RPT_GetPeriod(@PeriodName, A.PeriodDate)
end


Thank Code Project....This deserves a 10 not a 5...hehehehe!!


Skan

If you knew it would not compile why didn't you tell me?!?!?!

QuestionGetting Top 10 results per month/year Pin
_Joao_12-Sep-07 0:33
_Joao_12-Sep-07 0:33 
AnswerRe: Getting Top 10 results per month/year Pin
Blue_Boy12-Sep-07 3:19
Blue_Boy12-Sep-07 3:19 
GeneralRe: Getting Top 10 results per month/year Pin
Frank Kerrigan12-Sep-07 5:36
Frank Kerrigan12-Sep-07 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.