Empty value

I modified my report that can see the ConFirmedDate and ApproveDate in workflow history

here my SQL query.

select 
		max(CASE WHEN APPROVALSTATUS = 40 then DATEADD(hh, 8, CREATEDDATETIME) else '' end) as [CONFRIMED DATE],
		MAX(CASE WHEN APPROVALSTATUS = 30 then DATEADD(hh, 8, CREATEDDATETIME) else ''  end) as [APPROVED DATE]
		
		
from AGSSALESTABLEWORKFLOWHISTORY 
where DATAAREAID = 'inf' and APPROVALSTATUS != 10
group by SALESID,CREATEDBY

 

and translate into X++ code.

 

what's wrong with this code?

select maxof(CreatedDateTime), CreatedBy from workFlowHistory
    group by SalesId, CreatedBy
    where workFlowHistory.SalesId == salesTable.SalesId;

    if (workFlowHistory.ApprovalStatus == VersioningDocumentState::Confirmed)
    {
        _tmpWizPSDDSDR.ConfirmedBy = workFlowHistory.ApproverName();
        _tmpWizPSDDSDR.ConfirmedDate = workFlowHistory.createdDateTime;
    }
    if (workFlowHistory.ApprovalStatus == VersioningDocumentState::Approved)
    {
        _tmpWizPSDDSDR.ApproveBy = workFlowHistory.ApproverName();
        _tmpWizPSDDSDR.ApproveDate = workFlowHistory.createdDateTime;
    }

I am getting empty value.

can you help on this.

 

Thanks

Parents
No Data
Reply
  • Why this idea came up, its because i getting this problem. Please see below image with the red line box

    it should be a single row. like this

    SO ITEM Confirmed by  Confirmed date Approve by Approve date
    SO001 001 Mikey mouse 2/15/2017 5:40:38 PM Mini Mouse 2/15/2017 5:55:42 PM
    SO002 002 Bugs Bunny  2/16/2017 6:40:38 PM Road Runner 2/16/2017 6:55:48 PM

     

    how will i do it a single row ?

     

    Thank you.

Children
No Data
Related
Recommended