HowTo: Find manual only records including verified status
Edited
Q.1 How do I find every manual record in Elements, that has no other datasources?
;WITH ManualRecords AS (
SELECT [Publication ID], ID AS 'Manual Record ID'
FROM [Publication Record]
WHERE [Data Source] = 'Manual'
),
ObjectsWithNonManualRecords AS (
SELECT DISTINCT [Publication ID]
FROM [Publication Record]
WHERE [Data Source] <> 'Manual'
)
SELECT m.[Publication ID], m.[Manual Record ID]
FROM ManualRecords m
LEFT JOIN ObjectsWithNonManualRecords o ON m.[Publication ID] = o.[Publication ID]
WHERE o.[Publication ID] IS NULL
ORDER BY m.[Publication ID], m.[Manual Record ID]Q. For these manual records I want to know if they are verified?
Note: Lock status isn’t in the reporting database.
;WITH ManualRecords AS (
SELECT [Publication ID], ID AS 'Manual Record ID', [Verification Status], [Verification Comment]
FROM [Publication Record]
WHERE [Data Source] = 'Manual'
),
ObjectsWithNonManualRecords AS (
SELECT DISTINCT [Publication ID]
FROM [Publication Record]
WHERE [Data Source] <> 'Manual'
)
SELECT m.[Publication ID], m.[Manual Record ID], m.[Verification Status], m.[Verification Comment]
FROM ManualRecords m
LEFT JOIN ObjectsWithNonManualRecords o ON m.[Publication ID] = o.[Publication ID]
WHERE o.[Publication ID] IS NULL
ORDER BY m.[Publication ID], m.[Manual Record ID]Was this article helpful?
Sorry about that! Care to tell us more?
