Viewing 15 posts - 2,806 through 2,820 (of 4,087 total)
I did a quick comparison of Eirikur's and my methods. Here are the results:
1) Eirikur's method shorts the first row, because he starts with 1 rather than 0.
2)...
February 16, 2016 at 1:25 pm
Here is a different approach using a zero-based tally table. I've used a CTE to create a tally table, but you can skip that if you already have a...
February 16, 2016 at 9:21 am
I set up some sample data (only one subscriber) and come up with the following:
WITH Subscriptions AS (
SELECT *
FROM (
VALUES
(1, CAST('2014-01-01' AS DATE), CAST('2014-03-01' AS DATE))
,(1, '2014-02-01', '2014-05-01')
,(1, '2014-04-01', '2014-06-01')
,(1,...
February 11, 2016 at 11:39 am
Yes it is, but in doing so, your field tag now contains integer and character data, so you will have troubles shredding it later.
Select
ca.doc
From Main
Left Join Docs on...
February 11, 2016 at 10:02 am
The easy way to do this is to create the results that you are looking for and then globally replace all of the single quotes with two single quotes before...
February 11, 2016 at 9:32 am
If you are inserting col4 into col1, don't you want to use (col6 + col4)?
Drew
February 10, 2016 at 2:49 pm
Phil Parkin (2/9/2016)
What was the point of this?The response marked as a solution does not reference your table at all.
I thought that response was brilliant when I saw that it...
February 9, 2016 at 11:22 am
Ken McKelvey (2/9/2016)
IF (@date IS NULL)
SET @day = (SELECT MAX(day1) FROM table1 WHERE date1 = (SELECT MAX(date1) FROM table1));
ELSE
SET @day = (SELECT MAX(day1) FROM table1 WHERE date1 = @date);
I believe...
February 9, 2016 at 9:39 am
No, it's still a breaking change.
SELECT *
FROM (
VALUES(CAST(NULL AS DATE), CAST('2016-01-01' AS DATE)),
('2015-12-31', '2015-01-01'),
('2016-12-31', '2016-01-01')
) AS mc(TerminationDate, EffectiveDate)
ORDER BY ISNULL(mc.TerminationDate, mc.EffectiveDate) DESC
SELECT *
FROM (
VALUES(CAST(NULL AS DATE), CAST('2016-01-01' AS DATE)),
('2015-12-31', '2015-01-01'),
('2016-12-31',...
February 5, 2016 at 9:04 am
TJT (2/5/2016)
@Results returns387961
387962
You're confusing the RETURN status with the RESULT SET. Since @Results is an integer, it CANNOT contain two separate numbers. The RETURN status can be specifically...
February 5, 2016 at 8:50 am
TJT (2/5/2016)
OK, but even when I try this it doesn't workIF @Results > 10
PRINT 'Hello'
ELSE
PRINT 'OK thanks'
You need to be more specific. We need to know what the value...
February 5, 2016 at 8:40 am
Jacob Wilkins (2/4/2016)
drew.allen (2/4/2016)
Jacob Wilkins (2/4/2016)
Cheers!
EDIT: I must say that it is still strange that the unary plus works with string data, since the documentation specifies...
February 5, 2016 at 8:16 am
Hugo Kornelis (2/5/2016)
ChrisM@Work (2/5/2016)
ORDER BY MC.TerminationDate, MC.EffectiveDate DESC
I didn't go over all your modifications, but this one just struck my eye.
I think you intended this to be:
ORDER BY MC.TerminationDate DESC,...
February 5, 2016 at 7:56 am
Jacob Wilkins (2/4/2016)
Cheers!
EDIT: I must say that it is still strange that the unary plus works with string data, since the documentation specifies numeric data. However,...
February 4, 2016 at 3:11 pm
+ can be either a binary or unary operator. The first one is the binary operator and the second is the unary operator.
Drew
February 4, 2016 at 3:06 pm
Viewing 15 posts - 2,806 through 2,820 (of 4,087 total)