totalRecCount = (select count(RecId) from inventJournalTrans where inventJournalTrans.JournalId == _journalId && inventJournalTrans.TransDate == _transDate join inventTrans where inventTrans.InventTransId == inventJournalTrans.InventTransId && inventTrans.StatusIssue == StatusIssue::Sold && inventTrans.Qty != 0 ).RecId;