Viewing 15 posts - 2,701 through 2,715 (of 4,087 total)
pietlinden (5/8/2016)
select dateadd(mm, datediff(mm, 0, @ThisDate) + 1, 0) -- Beginning of next month
last day of the month is...
May 9, 2016 at 8:31 am
Con Alexis (5/8/2016)
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...
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...
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
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
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...
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...
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...
May 4, 2016 at 2:02 pm
Ed Wagner (5/3/2016)
SELECT TOP 2 DateColumn
FROM dbo.TableName
...
May 4, 2016 at 8:31 am
Reported as spam.
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...
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...
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...
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,...
April 29, 2016 at 7:28 am
Viewing 15 posts - 2,701 through 2,715 (of 4,087 total)