Viewing 15 posts - 16 through 30 (of 5,503 total)
Here's a solution that'll return the Fiscal year, month, and week based on a given year and the number of years to consider:
DECLARE @FY char(4)='2014',
@NumberOfYears TINYINT = 10
;
WITH cte AS...
December 23, 2014 at 2:56 pm
Looks like the usage of OUTER APPLY and the CASE expression will help here.
Depends on the query itself. Not enough information from my point of view...
December 23, 2014 at 1:13 pm
Based on the relational theory of RDBMS there's no "previous" row.
Whether a row is considered as "previous" or "next" depends on the order of rows.
What you could do is to...
December 23, 2014 at 9:14 am
It depends on the SQL version you're using...
If you use SS2K8 (as indicated by the forum you posted in), LAG is not available...
December 23, 2014 at 8:52 am
Even though it looks like an issue at the app layer, here's a link to a question over at stackoverflow including a query that'll list all user permissions including those...
December 23, 2014 at 8:51 am
I would have guessed that the user is in another role that deny the execution of that sproc...
Did you check the effective permission for that sproc?
EXECUTE AS USER = 'User';
SELECT...
December 23, 2014 at 8:08 am
Based on the logic provided so far, send the mail if @Result <> ''
You could use the following parameter in your email:
@query =
'SELECT ''Process Name: '' + CONVERT(VARCHAR(25),Process_Name...
December 23, 2014 at 7:44 am
"So the month ends on the first Sunday of the next month." does not match your sample data:
Month 5 (August) doesn't end at the first Sunday of the next month...
December 23, 2014 at 6:52 am
The only "useful" way to assign more than one row to a variable would be an xml data type (or varchar).
Obviously, we're still missing the whole picture. In your first...
December 23, 2014 at 6:48 am
Your description "we start a new month on the FIRST Sunday of the month." Does not match your sample "as it is the day after the first Sunday of the...
December 23, 2014 at 5:27 am
Based on Eirikurs solution here's a slightly modified version.
Differences: The code below does only one SELECT against the Process table and the result of the SELECT ist stored in a...
December 23, 2014 at 3:27 am
Hi Nancy,
obviously you presented just a piece of the puzzle.
It seems like somewhere in your code you're trying to assign a value to a variable or to use it as...
December 22, 2014 at 4:13 pm
CHARINDEX returns the first position of a given character, counted from the left side.
The sample data that return data have a similar pattern: the length of the last name is...
December 22, 2014 at 1:23 pm
What SQL Server version do you use?
December 22, 2014 at 12:42 pm
Just wrap it in a CTE:
; WITH cte AS
(
SELECT DISTINCT EDI_PARTNER_CD
FROM MG_EDI_PARTNER
UNION ALL
SELECT TOP 1 '(NULL)', EDI_PARTNER_CD
FROM ...
December 22, 2014 at 12:22 pm
Viewing 15 posts - 16 through 30 (of 5,503 total)