Viewing 15 posts - 3,436 through 3,450 (of 7,609 total)
David Burrows - Tuesday, April 24, 2018 6:40 AM
SELECT
DATEDIFF(day, COALESCE(date0,dateStart),date1),
DATEDIFF(day, COALESCE(date1,date0,dateStart),date2),
DATEDIFF(day, COALESCE(date2,date1,date0,dateStart),date3),
DATEDIFF(day, COALESCE(date3,date2,date1,date0,dateStart),date4),
DATEDIFF(day, COALESCE(date4,date3,date2,date1,date0,dateStart),date5),
DATEDIFF(day, COALESCE(date5,date4,date3,date2,date1,date0,dateStart),date6),
DATEDIFF(day, COALESCE(date6,date5,date4,date3,date2,date1,date0,dateStart),date7)
FROM temp
Nice, but I...
April 24, 2018 at 8:11 am
Yes. Author and Publisher do not belong in the table shown. I strongly doubt Edition or Media belongs there either.
I'm not sure about Date. I'm not sure how...
April 23, 2018 at 4:34 pm
;WITH cte_dates AS (
SELECT t.*, dates2.*
FROM temp t
CROSS APPLY (
SELECT
MAX(CASE WHEN row_num =...
April 23, 2018 at 4:17 pm
You'll probably get exactly the same execution plan either way.
But for ease of clarity, coding and maintenance, I'd write it this way:
SELECT sf.org,...
April 20, 2018 at 10:19 am
Again, the easiest solution is to simply split into two tables.
You can even keep the original table name if you:
1) Create the new table, with all the...
April 20, 2018 at 8:14 am
I don't know about "broken", but if you "uncluster" it normally, it runs fine.
And, yes, then you have two servers each running a single, separate, independent instance.
April 19, 2018 at 10:59 am
Somewhat confusing: "has ... active-active, active-passive setup". Huh, can't be both at the same time, which is it?
If A-P, I know we've undone/removed clustering and it worked fine,...
April 19, 2018 at 9:29 am
April 19, 2018 at 9:09 am
Difficult to tell exactly what you need, but if you want the other conditions to apply to "Developer" too, then do this:
WHERE (customer = @customer_number)...
April 19, 2018 at 8:22 am
April 19, 2018 at 7:43 am
April 18, 2018 at 2:37 pm
Use CAST (it's ANSI-standard), and CAST the final result as well, if you want a specific size of result:
CAST( CAST( SUM(Principal1) AS DECIMAL(5,2) ) + CAST ( SUM(BankInterest) AS DECIMAL(5,2)...
April 18, 2018 at 11:42 am
April 18, 2018 at 11:32 am
See if this gives you what you need -- it should at least be very close. Btw, T-SQL isn't like C#, you don't need separate statements for every calc.
April 18, 2018 at 9:57 am
Viewing 15 posts - 3,436 through 3,450 (of 7,609 total)