Viewing 15 posts - 616 through 630 (of 4,085 total)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 11, 2019 at 10:06 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 11, 2019 at 9:59 am
The first thing I would suggest is getting rid of your cteDates. It is doing absolutely nothing except wasting CPU time. If you decide that you need one in the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 8, 2019 at 3:58 pm
Use a CTE/ROW_NUMBER(). Since you didn't provide consumable data, this isn't tested.
WITH CTE AS
(
SELECT
A.EMPLID
, B.FIRST_NAME
, B.LAST_NAME
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 8, 2019 at 3:48 pm
This will work with most (all?) data types. I used DENSE_RANK() to filter out duplicates, but ROW_NUMBER() would work in a similar fashion.
WITH CTE AS
(
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 8, 2019 at 8:36 am
There is a write-up on Dwain Camps' site. Tally Tables. If can can, you want to use that to create an inline table-valued function.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 7, 2019 at 10:43 am
You query still doesn't contain a period, and I am not getting an error message when I run your code. The problem is somewhere else.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 7, 2019 at 10:35 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 7, 2019 at 8:49 am
I need to take into account events that ends at (for example) 10:00...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 6, 2019 at 3:42 pm
You generally want to return either XML values or comma-separated values, not both. It's not clear exactly what you are looking for, but the FOR XML clause can be used...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 6, 2019 at 2:45 pm
NineIron - Wednesday, March 6, 2019 10:16 AMThanx for the reply but, that's a bit more involved than 8 replace statements.
You asked...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 6, 2019 at 10:30 am
WITH Base AS ( SELECT * FROM (VALUES(0), (0), (0), (0), (0), (0), (0), (0), (0), (0) ) t(n) )
, Tally(n) AS (SELECT ROW_NUMBER() OVER(ORDER BY...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 6, 2019 at 10:09 am
I don't know that it's better, but you could split the string on spaces, filter the results, and then recombine the string.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 6, 2019 at 8:58 am
I have events on my database.
Every event has datetime to be started and datetime to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 5, 2019 at 4:08 pm
There are two issues here. The first one is identifying the correct group. Your English description doesn't match the code. Your English description says that the records should have the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 4, 2019 at 1:04 pm
Viewing 15 posts - 616 through 630 (of 4,085 total)