Viewing 15 posts - 286 through 300 (of 1,464 total)
I cannot see your tables or the data in them, so I cannot test the scripts.
The query that you have is not the same as the one that I posted. ...
January 13, 2021 at 10:00 am
@DesNorton - yes it works now but if the employee ID is there and he or she don't swipe then nothing is captured as it would appear as null....
January 13, 2021 at 7:52 am
If you have an unknown list of [Type], dynamic cross-tab queries are dealt with expertly and in great detail in these two Jeff Moden articles:
https://www.sqlservercentral.com/articles/cross-tabs-and-pivots-part-2-dynamic-cross-tabs
January 13, 2021 at 7:01 am
There is no need for the sub-query
SELECT sc.ID
, sc.[Name]
...
January 13, 2021 at 6:55 am
January 7, 2021 at 7:23 am
I don't like these massive procs with code branches. I would create a separate proc for each bucket. Then in this proc, EXEC the relevant new proc within each IF...
January 6, 2021 at 4:05 pm
What you need is a PIVOT or a Cross-Tab. The following SQL will work for your provided sample data
SELECT m.zplid
...
January 6, 2021 at 6:17 am
Hi Des
thanks for the answer it works well except for values which are zero then it doesn’t list them. how to list the zero values?
For example if I include...
January 5, 2021 at 2:36 pm
Why are you using a cursor? A simple sum with group by will do the trick
WITH cteHours AS (
SELECT emp_id
...
January 5, 2021 at 9:23 am
Just a thought ...
What about an exclusion table (or set of tables) that you can populate per customer. Then modify your queries to exclude data based on the config table.
As...
December 24, 2020 at 8:20 pm
Thanks for the suggestions. I am still curious to know why the MERGE statement deadlocks though. Any ideas?
Here is a page with a long list of known issues with...
November 17, 2020 at 9:52 am
On my SQL 2019 instance, the behaviour does not match your explanation
November 3, 2020 at 6:21 am
This should get you going in the right direction
;WITH cteBase AS (
SELECT TABLE1.ID, TABLE2.Processingnumber
, rn = ROW_NUMBER() OVER (PARTITION BY TABLE1.ID...
October 29, 2020 at 3:02 pm
The following code will not divide the values exactly. But since you have a large number of records, it uses the card number to split the records. It will guarantee...
October 27, 2020 at 3:44 pm
I believe that you are looking for fuzzy matches. I have never had to do it before, but this looks like it might get you started
October 26, 2020 at 3:27 pm
Viewing 15 posts - 286 through 300 (of 1,464 total)