Viewing 15 posts - 616 through 630 (of 4,087 total)
March 11, 2019 at 10:06 am
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...
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
...
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
(
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
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
March 7, 2019 at 10:35 am
I need to take into account events that ends at (for example) 10:00...
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...
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...
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...
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
March 6, 2019 at 8:58 am
I have events on my database.
Every event has datetime to be started and datetime to...
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...
March 4, 2019 at 1:04 pm
Viewing 15 posts - 616 through 630 (of 4,087 total)