May 11, 2016 at 8:36 am
Hello,
We have one report which send us daily created by SQL procedure.
I am attaching image for that report.
I donot want Remillard-Kunz Virginia three times. It is repeated in drop date column.
How could I get rid of this repeating values?
I tried to put distinct but its not worth try.
I am attaching code here.
Please give me suggestion to avoid repeating values.
Any help would be appreciated.
Thanks
May 11, 2016 at 4:16 pm
I'll try to be as kind as I can about that stored procedure. It's nicely laid out.
The problem with repeated rows is (probably - I don't know what your source table looks like) because the 2nd cursor includes CRS_CDE but the later list-building sql doesn't use CRS_CDE, so I'm guessing it returns 3 rows in the cursor, then, for each of those 3 rows, it finds those rows again as it builds the list.
It also looks like there are some bugs around the use of the @DAYSBACK variable because it's not used consistently.
I'll leave it there because I want to be kind.
May 11, 2016 at 4:57 pm
Thanks.
I solved this issue. I just replaced the drop date cursor code with add date course. I copied add date course cursor to drop date course and I stop getting multiple values.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply