MN WIC PROGRAM
Staff IDs & Names
STAFF MANAGEMENT (REVISED 6.28.16)
Report Overview
A list and count of currently active staff whose most recent login was at the specified agencies.
Includes the last login date, which displays in red if it has been more than 45 days since the last
login.
Some uses include:
•
Reference to associate usernames with staff names (for Infoview reports, etc.).
•
Obtain a list of currently active staff at specific agency.
•
Identify staff who should be deactivated.
Notes
▪
The staff listed in the report output are current users of HuBERT who have logged into the
system since July 1, 2013 and whose User IDs are active.
▪
Staff who have worked at more than one agency since July 1, 2013, will only display under
the agency where they most recently logged in.
▪
The LAST LOGIN date will display in red font if more than 45 days prior to the current date.
This is just an indicator to help assess whether staff might need to be deactivated. There
may be completely appropriate instances for staff to have not logged in for more than 45
days (such as staff who need access but don’t work in clinic often).
▪
This report output has been formatted to export to an 8.5 x 11 PDF (portrait). The report
output can also be exported to Excel (NOTE: the margins will need to be adjusted and the
headers/footers will not display).
▪
Page breaks occur at change of agency.
STAFF IDS & NAMES
INFOVIEW REPORT GUIDANCE DOCUMENT
Tab 1 – Staff IDs and Names
Prompts
TABLE
FIELD
SYSTEMACCESSLOG Agencyid
OPERATOR
In List
VALUE
PROMPT/DEFINITIONS
Enter 3-digit Agency ID(s).
The agency where the
(use semi-colon to
staff person most recently
separate; no spaces)
logged in.
### or ###;###
Static Criteria
Staff ID Query
USERPROFILE.Active Equal to Y
Explanation: Only display staff who are currently active
SQL (SELECT): MAX(SYSTEMACCESSLOG.Dateused)
Explanation: Select the most recent login date
SQL (FROM): (Select MAX(dbo.SYSTEMACCESSLOG.LOGENTRYID) as logid, dbo.SYSTEMACCESSLOG.USERID
FROM dbo.SYSTEMACCESSLOG
WHERE dbo.SYSTEMACCESSLOG.AGENCYID IN @prompt('Enter 3-digit Agency ID(s):','A','Dbo
Systemaccesslog\Agencyid',Multi,Free,Persistent,,User:0)
GROUP BY dbo.SYSTEMACCESSLOG.USERID) as Max
Explanation: Subquery to identify most recent login record
Page |2
STAFF IDS & NAMES
INFOVIEW REPORT GUIDANCE DOCUMENT
Tab 1 – Staff IDs and Names
Columns
▪
▪
▪
▪
STAFF ID (SYSTEMACCESSLOG.Userid)
LAST NAME (USERPROFILE.Lastname)
FIRST NAME (USERPROFILE.Firstname)
LAST LOGIN (SYSTEMACCESSLOG.Dateused)
Grouped by
Agency ID (Ascending)
Sorted by
▪
▪
▪
USER ID (Ascending)
LAST NAME (Ascending)
FIRST NAME (Ascending)
Counts
User ID (Distinct)
Page |3
STAFF IDS & NAMES
INFOVIEW REPORT GUIDANCE DOCUMENT
Technical Notes
Notes
The Agency ID and Clinic ID in the SYSTEMACCESLOG table were not stored correctly in the database prior to
7/1/13 because (they were truncated to 2 digits – this was fixed on 7/1/13). Due to this, the Agency ID won’t
match that entered into the PROMPT therefore only records after 7/1/13 will display.
REVISION 3.21.16 - When staff switch between agencies, they continue to be active and to have records assigned
to both agencies. To ensure they only display for the agency they are currently assigned to, a subquery was added
to take the max SYSTEMACCESSLOG.Logentryid (primary key). In order for this to work correctly, the Userid had to
be pulled from the SYSTEMACCESLOG table instead of the USERPROFILE table.
Alerters
GT 45 Days =DaysBetween([Dateused];CurrentDate()) > 45 turn font red
Formulas
Tab 1 – Staff ID and Names
Report Date (report header) ="Report Date: " + CurrentDate()
Agency Name (group header) =" " + [Name] + " (" + [Agencyid] + ")"
Page Numbers (report footer) ="Page " + Page()+" of "+NumberOfPages()
SQL (changes are highlighted)
Staff ID Query
SELECT
dbo.USERPROFILE.LASTNAME,
dbo.USERPROFILE.FIRSTNAME,
dbo.SYSTEMACCESSLOG.AGENCYID,
dbo.AGENCY.NAME,
dbo.SYSTEMACCESSLOG.LOGENTRYID,
dbo.SYSTEMACCESSLOG.USERID,
MAX(dbo.SYSTEMACCESSLOG.DATEUSED)
FROM
(
Select MAX(dbo.SYSTEMACCESSLOG.LOGENTRYID) as logid,
dbo.SYSTEMACCESSLOG.USERID
Page |4
STAFF IDS & NAMES
INFOVIEW REPORT GUIDANCE DOCUMENT
FROM dbo.SYSTEMACCESSLOG
WHERE
dbo.SYSTEMACCESSLOG.AGENCYID IN @prompt('Enter 3-digit Agency ID(s):','A','Dbo
Systemaccesslog\Agencyid',Multi,Free,Persistent,,User:0)
GROUP BY
dbo.SYSTEMACCESSLOG.USERID) as Max
INNER JOIN dbo.SYSTEMACCESSLOG ON (Max.logid = dbo.SYSTEMACCESSLOG.LOGENTRYID)
INNER JOIN dbo.USERPROFILE ON(dbo.USERPROFILE.Userid = dbo.SYSTEMACCESSLOG.Userid)
INNER JOIN dbo.AGENCY ON (dbo.AGENCY.AGENCYID=dbo.SYSTEMACCESSLOG.AGENCYID)
WHERE
(
dbo.SYSTEMACCESSLOG.AGENCYID IN @prompt('Enter 3-digit Agency ID(s):','A','Dbo
Systemaccesslog\Agencyid',Multi,Free,Persistent,,User:0)
AND
dbo.USERPROFILE.ACTIVE = 'Y'
)
GROUP BY
dbo.USERPROFILE.LASTNAME,
dbo.USERPROFILE.FIRSTNAME,
dbo.SYSTEMACCESSLOG.AGENCYID,
dbo.AGENCY.NAME,
dbo.SYSTEMACCESSLOG.LOGENTRYID,
dbo.SYSTEMACCESSLOG.USERID
Revisions
13.21.16 – A sub-query was added to identify the max login for active staff so that staff who
have switched between agencies will only show for the agency they most currently logged into
(are assigned to) – per TM at State.
6.28.16 – Added the LAST LOGIN date column and an Alerter that turns the date red if more
than 45 days from the current date.
Page |5
© Copyright 2026 Paperzz