Viewing 15 posts - 1 through 15 (of 63 total)
Thanks Luis. The Quirky Update worked perfectly 🙂
April 13, 2016 at 4:29 pm
Going back to a sample where I'm using the DENSE_RANK, here is another simple example:
CREATE TABLE [dbo].[testGroup](
[testRowID] [int] IDENTITY(1,1) NOT NULL,
[testLotID] varchar(5) NOT NULL,
[testDateTime] [datetime] NULL,
[testDays]...
April 13, 2016 at 12:42 pm
Thanks! This works.
March 15, 2016 at 9:11 am
Fantastic! I have never used ROWS UNBOUNDED PRECEDING but I'm going to start reading up on that functionality. Very useful.
Thanks, again!
Gina
January 21, 2014 at 3:58 pm
One more small request 🙂 The Balance returned from the cte is the Ending balance. Is there a way I can also get the Beginning balance for each...
January 21, 2014 at 3:47 pm
Wow! Both MickyT and TheSQLGuru results come back very fast with my live tran table. Thank you both so much for your help. This is exactly what...
January 21, 2014 at 2:56 pm
Thanks MickyT, this looks closer to what I'm trying to accomplish. I'd need the IntTranQty summed up to 1 row per period so if there are multiple transactions in...
January 21, 2014 at 1:46 pm
Thanks, Luis. When I originally posted the question, I didn't talk about the running balance, but since I added the test data I thought I'd go ahead and ask...
January 21, 2014 at 1:21 pm
OK, sorry about that. I'll start over. Here's code to build a sample @InventoryTran table:
DECLARE@InventoryTran TABLE (
IntLotKeyINT,
IntTranDateDATE,
IntTranQtyINT)
INSERT INTO @InventoryTran
SELECT27153IntLotKey, '1-1-2013' IntTranDate, 10IntTranQty
UNIONSELECT27153IntLotKey, '3-10-2013' IntTranDate, 20IntTranQty
UNIONSELECT27153IntLotKey, '5-15-2013' IntTranDate, 30IntTranQty
UNIONSELECT28468IntLotKey,...
January 21, 2014 at 12:17 pm
Thanks Igor. The link appears to be broken, but we ended up not uninstalling afterall. I believe I could have gone through the Control Panel > Add/Remove programs and...
May 2, 2013 at 10:06 am
Here is the sql I'm using for my testing, JLS. Let me know if this answers your question:
TRUNCATE TABLE testLotTrans
-- GET LOT TRANSACTIONS FOR EACH PudID
INSERT INTO testLotTrans
SELECTDISTINCT
cmpPudIDtmpPudID,
wkhHdrIDtmpHdrID,
IntKeytmpIntKey,
IntPodKeytmpPodKey,
IntLotKeytmpLotKey,
IntTranDatetmpTranDate,
IntTranQtytmpTranQty
FROMInventoryTran
INNER...
April 24, 2013 at 12:26 pm
JLS, I'm going to see if I can go back to your original code but instead of using the final output percent, I will see if I can get the...
April 24, 2013 at 10:11 am
Hi JLS,
I know it's not really straight forward. I've add comments to the attached spreadsheet to explain why some transactions have the same date/time and why I have to...
April 23, 2013 at 7:53 pm
I ran into a bit of a glitch with the solution, JLS. We have some situations where there was already gallons of wine in a lot prior to introducing...
April 22, 2013 at 7:05 pm
Viewing 15 posts - 1 through 15 (of 63 total)