Viewing 15 posts - 2,206 through 2,220 (of 4,087 total)
DesNorton (10/31/2016)
In order to group by Year/Month, you will need to use something like this, which groups by the 1st of every month.
-- ...
MonthYear = DATEADD(mm,...
October 31, 2016 at 8:57 am
sanda.jan00 (10/29/2016)
Thanks a lot from both of you!!!Now, consider the adjusted table provided by you, could you pls give me some advice how to write my query?? 🙂
You still haven't...
October 31, 2016 at 8:49 am
Suth (10/28/2016)
indicies ? do you mean indexes ?
Indices is the original Latin plural of index. Indexes is the Anglicized version of the plural. Both are acceptable in English....
October 31, 2016 at 8:26 am
david.jack (10/28/2016)
ScottPletcher (10/27/2016)
Seems more confusing than the natural CASE statement to me:SUM(CASE WHEN VAL1 <> 0 THEN VAL1 ELSE VAL2 END)
VAL1 can return NULL unfortunately so using a comparison operator...
October 28, 2016 at 8:05 am
steve.bradford (10/27/2016)
Are any records returned if you use DATALENGTH(ID) > 15? LEN() automatically trims.
Since this thread is almost three years old and the OP hasn't made any recent updates,...
October 27, 2016 at 4:19 pm
I think that this approach may still be faster, especially with the right indexes in place. I created a Student table, a SchoolDay table, and the TruantDay. I...
October 27, 2016 at 4:15 pm
Does your TruantDay table only contain absences or does it contain all attendance information? If it's all information, there is a much faster approach.
Drew
October 27, 2016 at 4:02 pm
I think the only problem with your original query was using the ChildID from the wrong table in the second part of the rCTE.
DECLARE @Temp TABLE (descr CHAR(5), ChildID TINYINT,...
October 27, 2016 at 3:32 pm
Actually, XML uses Unix-style line terminators (LF) rather than Windows-style (CR/LF), so it's not necessary to test for CHAR(13) unless the XML document specifically contains the character encoding for CR...
October 27, 2016 at 2:43 pm
btio_3000 (10/27/2016)
'<root>
<name>hand
<val>strong</val>
</name>
<name>mind
<val>beautiful</val>
</name>
</root>'
I need to return val...
October 27, 2016 at 1:11 pm
sp_MSforeachDB does not automatically change the context to each database, so it executes in the context of the database where you originally run the query. Preface your dynamic SQL...
October 27, 2016 at 11:37 am
Actually, the problem is that you're converting int to char back to int. If you want integers keep them as integers.
DECLARE @START_DT AS datetime = '2015-01-01 00:00:00.000';
WITH E1 AS...
October 27, 2016 at 9:59 am
Depending on what indexes you have in place, one of these version may perform better.
SELECT ml.ID, ml.Cat, ml.Status
FROM #MasterList ml
WHERE NOT EXISTS (
SELECT 1
FROM #ListX lx
WHERE ml.ID = lx.ID
AND ml.Cat...
October 27, 2016 at 8:47 am
esayasas (10/26/2016)
What caused performance issue in SQL server?
This thread is over seven years old, and the original poster hasn't logged in in almost seven years. At this point, it...
October 26, 2016 at 1:49 pm
Jeff Moden (10/26/2016)
drew.allen (10/26/2016)
Jeff Moden (10/25/2016)
October 26, 2016 at 1:43 pm
Viewing 15 posts - 2,206 through 2,220 (of 4,087 total)