Viewing 15 posts - 1 through 15 (of 130 total)
November 7, 2018 at 7:08 am
Nice article Greg.
I've had to use CASE expressions quite often recently in a data migration from an old ERP system.
You not only just taught me a few new tricks...
April 20, 2016 at 6:02 am
Keep on Keeping on and enjoy your weekend!
November 20, 2015 at 10:47 am
J Livingston's query runs faster. Both solutions work well.
Sorry for the late reply but it really helped me in crunch.
August 19, 2015 at 8:25 am
OK, Your right I didn't have
left join SumSalesQtyCommit as sot
On sot.[No.] = ile.[Item No.] and sot.[Location Code] = ile.[Location Code]
On sot.[No.] = ile.[Item No.]...
August 25, 2014 at 8:39 pm
Thanks for the suggestion Mickey but even with the test data I only get two results back.
August 25, 2014 at 6:57 pm
Here is some more sample data.
If you run the Inner query for #ItemLedgerEntry you will see 8 results appear.
For the Locations that have no records for...
August 25, 2014 at 3:06 pm
This is very close but when I run it in my production system I only get back 2 records. The results I get back are the results where there...
August 25, 2014 at 2:36 pm
When I run the query in the actual database I get back over 7,000 records for 1 item. I should only get 8 results back for this item....
August 25, 2014 at 2:22 pm
this worked well. Thanks for the assistance!
here is the final script. I'll be adding more onto it but this was a good start.
WITH SumInvoiceQty AS
SELECT [Item No_],...
August 20, 2014 at 3:33 pm
That's money!! I'll run it on my actual table in the morning. This way isn't that expensive either when compared to the windowing function. Thanks for your input.
June 4, 2014 at 6:31 pm
Thanks all. Your SQL skills humble me all the time. Amazing detail as always. I am so thankful to be part of such a community.
March 12, 2014 at 2:59 pm
Sure, so I'll explain what I found in my data analysis.
The original CTE you wrote would have set the flag for the Blocked and DoNotUse columns. I originally did...
February 25, 2014 at 8:08 am
I think this will work. I just changed the sort order of Historical in the ranking function.
with NumberedSet as
SELECT ItemNo, Blocked, DoNotUse, Historical, rn = ROW_NUMBER() OVER (PARTITION...
February 25, 2014 at 7:58 am
thanks for your post. I agree with the usage of the CTE. I'll definitely use that method. After doing some data analysis on your script and some changes on...
February 25, 2014 at 7:43 am