Viewing 15 posts - 1 through 15 (of 17 total)
Hi Lynn,
I think the final query is. Yes I posted the result
when I query the EditLog table
SELECT *
FROM dbo.EditLog AS EL
WHERE EL.NoteText = 'change value from 30 to...
April 28, 2015 at 2:12 pm
Here is the final query for the view:
SELECT NS.LocCode
,NS.LocationDesc
,NS.PrdName
,NS.ProductDescription
,NS.PkgCode
,VE.Label
,E.PlanId
,P.Description
,E.TransId
,E.EventTypeId
,CONVERT(INT,ROUND(SUM(E.Qty),0)) AS Quantity
,EL.Id
,EL.EditData
,EL.PlanId
,EL.TransId
,PP.PeriodLabel
,EL.EntityId
,CONVERT(INT,ROUND(SUM(EL.QtyPrior),0)) AS [Quantity Prior]
,EL.Description
,EL.NoteText
FROM dbo.Event AS E
INNER JOIN dbo.ADMC_DDL_GetUniqueEditLog() AS EL
ON EL.PlanId = E.PlanId
AND EL.TransId = E.TransId
LEFT JOIN dbo.NodeSku AS...
April 28, 2015 at 1:31 pm
Your previous question - if this is the only value you want returned, is this based on PlanId, TransId, or EntityId? If there are different PlanIds, TransIds, or EntityIds what...
April 28, 2015 at 12:25 pm
This the result of the function: this is good
SELECT * FROM dbo.ADMC_DDL_GetUniqueEditLog()
3029 2013-01-08 15:00:21.91013144379005410 2160EDIT NULL
838072015-04-24 10:25:58.42015206348842011500 10000EDIT
I posted the...
April 28, 2015 at 12:17 pm
Lynn,
Yes, something like your example that has (blah, change from 2 to 3.
Here is the final query I'm working with.
SELECT E.PlanId AS [Plan]
,P.[Description] AS [Plan Description]
,NS.LocCode AS [Location Code]
,NS.LocationDesc...
April 28, 2015 at 11:31 am
Here is the create table statement
CREATE TABLE [dbo].[EditLog_back](
[Id] [INT] IDENTITY(1,1) NOT NULL,
[EditDate] [DATETIME] NOT NULL,
[PlanId] [INT] NOT NULL,
[TransId] [INT] NOT NULL,
[EntityId] [INT] NOT NULL,
[QtyPrior] [FLOAT] NULL,
[QtyAfter] [FLOAT] NOT NULL,
[Description] [VARCHAR](255)...
April 28, 2015 at 11:02 am
Here are some inserts
INSERT INTO dbo.EditLog_back(EditDate,PlanId,TransId,EntityId,QtyPrior,QtyAfter,Description,NoteText)
VALUES (GETDATE(),15,2063526918,1,16.1538461538461,8.33333333333333,'EDIT','change from 48 to 25');
INSERT INTO dbo.EditLog_back(EditDate,PlanId,TransId,EntityId,QtyPrior,QtyAfter,Description,NoteText)
VALUES (GETDATE(),15,2063526918,1,16.1538461538461,8.33333333333333,'EDIT','change from 48 to 25');
INSERT INTO dbo.EditLog_back(EditDate,PlanId,TransId,EntityId,QtyPrior,QtyAfter,Description,NoteText)
VALUES (GETDATE(),15,2063526918,1,16.1538461538461,8.33333333333333,'EDIT','change from 48 to 25');
INSERT INTO dbo.EditLog_back(EditDate,PlanId,TransId,EntityId,QtyPrior,QtyAfter,Description,NoteText)
VALUES...
April 28, 2015 at 10:20 am
Lynn,
I included some data from the EditLog table in previous post.
I get the following error when creating the function
Msg 4514, Level 16, State 1, Procedure ADMC_DDL_GetUniqueEditLog, Line 25
CREATE FUNCTION...
April 28, 2015 at 10:05 am
Hi Gail,
Here is the DDL table
ALTER FUNCTION [dbo].[ADMC_DDL_GetUniqueEditLog]()
RETURNS @EditLog TABLE(
Id INT NOT NULL
,EditDate DATETIME NOT NULL
,PlanId INT NOT NULL
,TransId INT NOT NULL
,EntityId INT NOT NULL
,QtyPrior FLOAT NULL
,QtyAfter FLOAT NOT NULL
,Description...
April 28, 2015 at 9:27 am
Lynn, this is the table.
CREATE TABLE [dbo].[EditLog](
[Id] [INT] IDENTITY(1,1) NOT NULL,
[EditDate] [DATETIME] NOT NULL,
[PlanId] [INT] NOT NULL,
[TransId] [INT] NOT NULL,
[EntityId] [INT] NOT NULL,
[QtyPrior] [FLOAT] NULL,
[QtyAfter] [FLOAT] NOT NULL,
[Description]...
April 24, 2015 at 3:11 pm
Thank Lowell, please advise what will be the best field(s) to group by.
April 24, 2015 at 2:54 pm
Thanks Lowell, please advise what will be the best field(s) to group by.
April 24, 2015 at 2:53 pm
here is some some records. all are same records but the edit time are different. I would like to have a cursor or something else that can through the...
April 24, 2015 at 2:39 pm
CREATE FUNCTION dbo.ADMC_DDL_GetUniqueEditEdit()
RETURNS @EditLog TABLE(
Id INT NOT NULL
,EditDate DATETIME NOT NULL
,PlanId INT NOT NULL
,TransId INT NOT NULL
,EntityId INT NOT NULL
,QtyPrior FLOAT NULL
,QtyAfter FLOAT NOT NULL
,Description VARCHAR(255) NULL
,NotText NVARCHAR(max) NULL
)
AS
BEGIN
INSERT INTO...
April 24, 2015 at 2:29 pm
Viewing 15 posts - 1 through 15 (of 17 total)