Hello, I have the following SQL to retrieve the tenders off of a particular check however I am trying to retrieve the Reference Entry that was typed in during settlement for that particular tender. Does anyone know if this exists in the MCRSPOS.MICROSDB database? I know where to find the reference entry in LOCATION_ACTIVITY_DB however this database lags behind MICROSDB by a couple minutes and for this use case, I need to be able to retrieve the information as soon as the check is closed. This query below works immediately after the check is closed, I just need to get the Reference Entry input attached to the Tender Media somehow. Any thoughts?
SELECT r.ObjectNumber, c.CheckID, c.CheckNumber, c.RevCtrID, c.AlternateID, c.CheckOpen, tm.ObjectNumber, st.StringText
--, st.StringText
FROM mcrspos.microsdb.checks c
INNER JOIN mcrspos.microsdb.REVENUE_CENTER r ON c.RevCtrID=r.RevCtrID
INNER JOIN mcrspos.microsdb.check_detail cd ON cd.CheckID=c.CheckID
INNER JOIN mcrspos.microsdb.TENDER_MEDIA tm ON tm.ObjectNumber=cd.ObjectNumber AND cd.DetailType=4
INNER JOIN mcrspos.microsdb.TENDER_MEDIA_DETAIL tmd ON tmd.TendMedID=tm.TendMedID AND tmd.CheckDetailID=cd.CheckDetailID
INNER JOIN mcrspos.microsdb.STRING_TABLE st ON st.StringNumberID=tm.NameID
WHERE c.checkNumber=25083
AND c.Version=1
SELECT r.ObjectNumber, c.CheckID, c.CheckNumber, c.RevCtrID, c.AlternateID, c.CheckOpen, tm.ObjectNumber, st.StringText
--, st.StringText
FROM mcrspos.microsdb.checks c
INNER JOIN mcrspos.microsdb.REVENUE_CENTER r ON c.RevCtrID=r.RevCtrID
INNER JOIN mcrspos.microsdb.check_detail cd ON cd.CheckID=c.CheckID
INNER JOIN mcrspos.microsdb.TENDER_MEDIA tm ON tm.ObjectNumber=cd.ObjectNumber AND cd.DetailType=4
INNER JOIN mcrspos.microsdb.TENDER_MEDIA_DETAIL tmd ON tmd.TendMedID=tm.TendMedID AND tmd.CheckDetailID=cd.CheckDetailID
INNER JOIN mcrspos.microsdb.STRING_TABLE st ON st.StringNumberID=tm.NameID
WHERE c.checkNumber=25083
AND c.Version=1