Viewing 15 posts - 16 through 30 (of 428 total)
Hmm, you are grouping by the same columns you are averaging, so that probably isn't giving you what you want.
Also the OVER clause is only being applied to the...
May 25, 2018 at 8:43 am
Hmm, it shouldn't. I suspect the error is actually somewhere else.
The aliases I put on the average column results are invalid because they start with a number. Try removing...
May 25, 2018 at 8:07 am
Ah, so for every row, you want to average each of the SSI columns for all rows within 24 hours prior to the current row date/time?
I doubt this...
May 24, 2018 at 10:31 am
Sorry I didn't figure you needed the end date, since you have it as the start date of the next row.
If you really need that on the same...
May 24, 2018 at 9:18 am
Would something like this work for you?
SELECT
Location,
DateValue, Sum(Number)
FROM
#_tempData TheData
JOIN
(
SELECT StartDate AS DateValue
FROM...
May 23, 2018 at 8:00 am
Here's an example using just table joins:
;WITH TabData (Code, Date, Type)
AS
(
SELECT
Code, Date, type
FROM
@tabData
)
SELECT
Full_Data.Code,
May 21, 2018 at 12:35 pm
Should the SELECT have a try_cast in it as well?
My understanding is that with larger data sets, it is possible for the optimizer to validate results before applying filters.
May 14, 2018 at 7:27 am
Three or those are included due to commas in the name, which have not been excluded by the pattern. I think you are past the problem of special characters in...
April 16, 2018 at 6:51 am
Interesting... it looks like escaping the square brackets only works when you explicitly specify the escape character for some reason?
Give this a shot:
DECLARE...
April 13, 2018 at 12:52 pm
The underscore is a single character wildcard in LIKE expressions.
You'll need to encapsulate it in square brackets:
Select *
from [XLSFiles]
where fullimagepath like '%[^a-zA-Z0-9.&[_]-#$\\()...
April 13, 2018 at 10:55 am
Add another variable to hold the previous group value, so you can store the current and previous values in variables.
On each loop, update current value via cursor, compare it...
April 13, 2018 at 10:30 am
April 12, 2018 at 6:06 am
March 19, 2018 at 8:02 am
Viewing 15 posts - 16 through 30 (of 428 total)