I have constructed the query below, but the OwningUser field displays a numeric value, and not the OwningUser's name. This info is located in a table called:
dbo.SystemUserBase and the field I need is the FirstName field from this table.
How do I construct this query so that I can get the OwningUser's FirstName from the dbo.SystemUserBase table and display that in my query?
Any help is appreciated.
-----------------------------
SELECT CFScompanyname, TicketNumber, CreatedOn, StatusCode, Title, OwningUser
FROM dbo.incidentbase WHERE
(
CFScompanyname like 'EMC%' or
CFScompanyname like 'BERE%' or
CFScompanyname like 'TRE%'
)
AND
(
StatusCode = 2 or
StatusCode = 7 or
StatusCode = 13 or
StatusCode = 9 or
StatusCode = 4 or
StatusCode = 1 or
StatusCode = 8 or
StatusCode = 3
)
ORDER BY CFScompanyname
dbo.SystemUserBase and the field I need is the FirstName field from this table.
How do I construct this query so that I can get the OwningUser's FirstName from the dbo.SystemUserBase table and display that in my query?
Any help is appreciated.
-----------------------------
SELECT CFScompanyname, TicketNumber, CreatedOn, StatusCode, Title, OwningUser
FROM dbo.incidentbase WHERE
(
CFScompanyname like 'EMC%' or
CFScompanyname like 'BERE%' or
CFScompanyname like 'TRE%'
)
AND
(
StatusCode = 2 or
StatusCode = 7 or
StatusCode = 13 or
StatusCode = 9 or
StatusCode = 4 or
StatusCode = 1 or
StatusCode = 8 or
StatusCode = 3
)
ORDER BY CFScompanyname