Viewing 15 posts - 3,286 through 3,300 (of 3,957 total)
Perhaps something like this?
SELECT ID, UName, alert_datetime
,Diff=CONVERT(VARCHAR(15), CAST(DATEADD(millisecond, (
SELECT DATEDIFF(millisecond, t2.alert_datetime, t1.alert_datetime)
...
June 26, 2012 at 8:27 pm
EL Jerry (6/26/2012)
The BOOLEAN data type would only have two values: TRUE or FALSE. Not 0, 1 or NULL, just TRUE or FALSE. This is why it would...
June 26, 2012 at 8:09 pm
If you want Availability to end up as a DATE datatype, the trouble is obviously with the date that is missing the day. You can handle that like this...
June 26, 2012 at 7:22 pm
anush_tar (6/26/2012)
This is a part of SP, I...
June 26, 2012 at 6:34 pm
Les Cardwell (6/26/2012)
DROP TABLE #T;
CREATE TABLE #T(Col1 INT)
INSERT INTO #T
SELECT 1 UNION ALL
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 1
--SELECT SUM(DISTINCT(Col1)) AS 'Sum of...
June 26, 2012 at 6:32 pm
Tom Bakerman (6/26/2012)
dwain.c (6/25/2012)
SELECT x.MyId, MIN(MinAmt)
FROM #test
CROSS APPLY (
VALUES (MyID, MV1), (MyID, MV2), (MyID, MV3), (MyID, MV4)) x(MyID, MinAmt)
WHERE MinAmt >= 150
GROUP BY x.MyID
I've...
June 26, 2012 at 6:22 pm
dwain.c (6/24/2012)
June 25, 2012 at 5:33 pm
You can also do it like this:
SELECT x.MyId, MIN(MinAmt)
FROM #test
CROSS APPLY (
VALUES (MyID, MV1), (MyID, MV2), (MyID, MV3), (MyID, MV4)) x(MyID, MinAmt)
WHERE MinAmt >= 150
GROUP BY x.MyID
I've run some performance...
June 25, 2012 at 12:04 am
This is not guaranteed to work in all cases (e.g., where @ may appear outside of an email string) but using Jeff Moden's DelimitedSplit8K string splitter, you can try something...
June 24, 2012 at 11:48 pm
dwain.c (6/22/2012) Did you check to see if this solution is any faster?
To answer my own question:
CPU ...
June 22, 2012 at 9:22 pm
chris.stuart (5/17/2012)
I always enjoy reading the articles, but this one got me a bit stumped. Where would you actually use this?:unsure:
To Chris and all the folks out there that took...
June 22, 2012 at 8:13 pm
rgldiatr (6/22/2012)
rgldiatr (6/22/2012)
CROSS APPLY (SELECT StartDt + n FROM Tally WHERE EndDt >= StartDt + n) x(date2)
What is the "x(date2)"...
June 22, 2012 at 7:38 pm
Sean Lange (6/22/2012)
SQL_Kills (6/22/2012)
Thanks for your advice so far and what you have shown me.
The table you created QuestionFieldsNormalized was what the table originally looked like that when pulling the...
June 22, 2012 at 7:34 pm
Les Cardwell (6/22/2012)
June 22, 2012 at 7:28 pm
Les Cardwell (6/22/2012)
June 22, 2012 at 7:27 pm
Viewing 15 posts - 3,286 through 3,300 (of 3,957 total)