dylangetssmart / NeedlesNeos-BrianWhite

0 stars 0 forks source link

Notes - missing created by #5

Open dylangetssmart opened 2 weeks ago

dylangetssmart commented 2 weeks ago

An artifact of users.saga being null.

Update [notnRecUserID]

dylangetssmart commented 1 week ago
SELECT
    notes.SAGA, notes.notnRecUserID, u.usrnUserID, n.staffcreatedid,s.staff_code, s.full_name
FROM sma_trn_notes notes
JOIN BrianWhiteNeos..case_notes_Indexed n
    ON notes.SAGA = CONVERT(VARCHAR(50), n.ID)
LEFT JOIN [sma_MST_Users] U
    ON U.saga = CONVERT(VARCHAR(50), n.staffcreatedid)
JOIN BrianWhiteNeos..staff s
on s.id = n.staffcreatedid
where notes.SAGA is not null AND u.usrnuserid is not null
-- 287,184 missing saga
-- 317,516 total notes
-- 65,198 where user exists

SELECT * FROM BrianWhiteNeos..staff ORDER BY  full_name
SELECT * FROM sma_MST_Users smu order BY usrsloginid
SELECT* FROM implementation_users STF order BY full_name