Viewing 15 posts - 16 through 30 (of 147 total)
Agreed.
This was just a sample of the actual code which is a bit more complicated and I do convert it to actual dates.
Thanks
June 22, 2018 at 11:54 pm
Great.
I also made a small change that lets me select the range. If @Choice is NULL, it will work as you have it. @Choice is the number of years...
June 21, 2018 at 3:43 pm
My mistake.
You're right. I just marked the latest one. Didn't notice that the answer was right above it.
And yes, I do understand how it works. Was...
June 12, 2018 at 12:15 pm
I forgot I was on 2008. I use both servers.
This gave me what I needed.
Thanks.
June 12, 2018 at 12:10 pm
I tried that but got the following error:
Msg 102, Level 15, State 1, Line 25
Incorrect syntax near 'ROWS'.
Am I missing something?
I...
June 11, 2018 at 1:45 am
I was able to use this in the actual select statement and it worked perfectly.
Thanks.
June 11, 2018 at 1:32 am
That doesn't sum anything because the join only passes back one row.
I get this a the answer:
FullName NewType (No column name) (No column name)
Tom Emp 10 20
The amounts...
June 8, 2018 at 6:18 pm
I got it to work.
All I did was change the where clause alias from:
WHERE bij
April 19, 2018 at 4:55 pm
I was curious if there was a similar more efficient way to do a pivot without the normal way of doing it. As with the other one, I have a...
April 18, 2018 at 11:49 pm
I will.
Also, I never saw Cross Apply used this way. I can't find anywhere where it shows defining the columns outside of the cross apply in the alias. ...
April 16, 2018 at 1:42 pm
I guess yu can look at the execution plans.
If you look at just the last query for both samples, it does look like the new one does less...
April 16, 2018 at 10:00 am
Also, you said it was more efficient. How would we check that other than run it. In this case, both are fast so I can't really tell.
April 16, 2018 at 9:51 am
I just applied it to my real query and it does allow me to get rid of the casting for the string literals and the substring piece that tied the phone...
April 16, 2018 at 9:46 am
That looks great and does look simpler. It also looks easier for someone else to make changes to.
And I think it also handles the issue of the strings...
April 16, 2018 at 9:02 am
Viewing 15 posts - 16 through 30 (of 147 total)