Viewing 15 posts - 2,701 through 2,715 (of 4,085 total)
Con Alexis (5/8/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 9, 2016 at 8:13 am
o103452 (5/6/2016)
Sergiy (5/5/2016)
Not sure if it's good or bad, but there...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 6, 2016 at 8:43 am
o103452 (5/5/2016)
I'm working on modifying the fiscal date script from here.
I'm trying to figure out how to calculate the following.
FiscalWkofQrt
-- Week # of each querter where it resets every...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 5, 2016 at 4:42 pm
Given the name MASTER_CODING_RESULTS_ID, it's highly likely that this is the primary key, in which case there is no reason to reference the table more than once.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 5, 2016 at 4:29 pm
If you want a unique identifier with all zeroes, you can always do the following.
SELECT CAST(0x0 AS UNIQUEIDENTIFIER)
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 5, 2016 at 4:23 pm
SQL Prompt will automatically adjust the case, so I don't care whether caps lock is on. Also, it becomes quickly obvious as you're typing that the wrong case is...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 3:01 pm
This is my best guess at doing this WITHOUT A CURSOR.
I combined your two derived tables into one by using the LAG function and removed unnecessary conditions in your CASE...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 2:52 pm
Alan.B (5/4/2016)
ROW_NUMBER does not take ties into consideration, RANK and DENSE_RANK do.
I would phrase that differently. They all take ties into consideration: RANK and DENSE_RANK treat ties as...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 2:02 pm
Ed Wagner (5/3/2016)
SELECT TOP 2 DateColumn
FROM dbo.TableName
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 8:31 am
Reported as spam.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 8:25 am
salliven (5/4/2016)
;with cte as (
select TOP (select ((MD.TotalCount*80)/100) as TotalCount from [dbo].[Message_Identifier] MD where MD.MessageID = 1141)
DMQD.SubmitDate
from [dbo]. message_queue_details
DMM DMM.MessageID = 1141
order by SubmitDate
)
select
DATEDIFF(SECOND,MIN(SubmitDate), MAX(SubmitDate)) as TimeDiff
from cte
I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 4, 2016 at 8:10 am
ScottPletcher (5/3/2016)
You should check the tables in the order of most likely to EXIST first, so...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 3, 2016 at 11:17 am
PSB (5/3/2016)
Server is UTC time zone .I just need to delete today's records and insert new ones and keep yesterday and older records. Rest (time zone) is not mandatory.
If the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 3, 2016 at 9:58 am
John Mitchell-245523 (4/29/2016)
SELECT DISTINCT
ID
,IDDATE
,FIRST_VALUE(FROMID) OVER (PARTITION BY ID, IDDATE ORDER BY JID) AS FROMID
,FIRST_VALUE(TOID) OVER (PARTITION BY ID,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 29, 2016 at 7:28 am
dhanekulakalyan (4/26/2016)
Thank you I need to check with ltrim(rtrim(avg(datesdiff))) to get in one row. I will keep you posted .
LTRIM() will remove leading spaces, RTRIM() will remove trailing spaces....
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 27, 2016 at 8:29 am
Viewing 15 posts - 2,701 through 2,715 (of 4,085 total)