M
mralmackay
I've been trying to work on a query to do resolved 1st time based on
some recommendations through the groups.
However... this isn't still quite working as I need it to. So far
I've done the following:
INSERT INTO tblResolved1stTime ( [Case-ID], [Created-By], [Closed-By],
[Create-Date], [Closed-Date], Resolved1stTime, [Primary-Group] )
SELECT DISTINCT [P2P-Request].[Case-ID], [P2P-Request].[Created-By],
[P2P-Request].[Closed-By], [P2P-Request].[Create-Date], [P2P-Request].
[Closed-Date], IIf(DateDiff("n",[P2P-Request].[Create-Date],[P2P-
Request].[Closed-Date])<=60 And [P2P-Request].[Closed-By]=[P2P-
Request].[Created-By],"Yes","No") AS [Resolved 1st Time], User.
[Primary-Group]
FROM [User] LEFT JOIN [P2P-Request] ON User.[Full-Name] = [P2P-
Request].[Created-By]
WHERE ((([P2P-Request].[Case-ID]) Is Not Null) AND ((User.[Primary-
Group]) Like "%Help%"));
This inserts records successfully into the table specified
(tblResolved1stTime) the first time I run it. However when I run it
when new records have been created (in P2P-Request) I only want it to
post records in where the Case-ID within P2P-Request doesn't already
exist in tblResolved1stTime.
Case-ID is a unique field in each table.
Any suggestions on how I can do this part? Thanks in advance, Al.
some recommendations through the groups.
However... this isn't still quite working as I need it to. So far
I've done the following:
INSERT INTO tblResolved1stTime ( [Case-ID], [Created-By], [Closed-By],
[Create-Date], [Closed-Date], Resolved1stTime, [Primary-Group] )
SELECT DISTINCT [P2P-Request].[Case-ID], [P2P-Request].[Created-By],
[P2P-Request].[Closed-By], [P2P-Request].[Create-Date], [P2P-Request].
[Closed-Date], IIf(DateDiff("n",[P2P-Request].[Create-Date],[P2P-
Request].[Closed-Date])<=60 And [P2P-Request].[Closed-By]=[P2P-
Request].[Created-By],"Yes","No") AS [Resolved 1st Time], User.
[Primary-Group]
FROM [User] LEFT JOIN [P2P-Request] ON User.[Full-Name] = [P2P-
Request].[Created-By]
WHERE ((([P2P-Request].[Case-ID]) Is Not Null) AND ((User.[Primary-
Group]) Like "%Help%"));
This inserts records successfully into the table specified
(tblResolved1stTime) the first time I run it. However when I run it
when new records have been created (in P2P-Request) I only want it to
post records in where the Case-ID within P2P-Request doesn't already
exist in tblResolved1stTime.
Case-ID is a unique field in each table.
Any suggestions on how I can do this part? Thanks in advance, Al.