Viewing 15 posts - 3,646 through 3,660 (of 7,614 total)
Below is alternative method that's closer to the original technique (for good or ill). Btw, there's a minor bug in the other code that doesn't reduce the day count if...
December 19, 2017 at 8:28 am
December 15, 2017 at 8:00 am
Your pattern requires two spaces between the date and the time, and your value only has one space.
Also, you didn't explicitly specify the \ as the escape character:
December 15, 2017 at 6:50 am
Impossible to say. It depends primarily on (1) how much free space is available in each page already, (2) as noted already, how many affected indexes there are on each table.
December 15, 2017 at 6:46 am
Select
t1.Salesagent,
SUM(CASE WHEN MONTH(t1.DateCompleted) BETWEEN 1 AND 3 THEN 1 ELSE 0 END) AS Quarter1_Sales_Count,
SUM(CASE WHEN MONTH(t1.DateCompleted) BETWEEN 4 AND ...
December 14, 2017 at 10:24 am
When joining to do UPDATEs, always update the table alias not the table name itself. Otherwise you could have the same problem (or other problems).
UPDATE ...
December 14, 2017 at 10:20 am
Specifically what row selection conditions do you want? Your sample is not clear. But you almost certainly don't need CASE in any event.
It sounds like you may actually...
December 12, 2017 at 3:01 pm
Could you provide actual test data, as CREATE TABLE and INSERT statements, rather than just a picture of data. We can't write code against a picture .🙂
December 12, 2017 at 2:50 pm
There's no need to join the group row to itself, so this is another possibility:
SELECT c.*
FROM #companies c
LEFT OUTER JOIN #companies g
...
December 8, 2017 at 9:12 am
If the values are integers, I don't see the need to involve date conversions/char stringing at all:
SELECT yyyymm1, yyyymm2, (yyyymm2 / 100 * 12 +...
December 8, 2017 at 9:06 am
For those indexes, you could drop both index1 and index2.
December 7, 2017 at 7:42 am
December 7, 2017 at 7:37 am
/* this block should only get executed on the first iteration */
DECLARE @greeting VARCHAR(100);
SET @greeting = 'Hello';
/* ==================== */
/* I want this block...
December 6, 2017 at 3:30 pm
FYI, fwiw, there's some slight differences in the sample data being used and the original sample data picture. Here's the adjusted data:
INSERT INTO...
December 6, 2017 at 12:49 pm
Viewing 15 posts - 3,646 through 3,660 (of 7,614 total)