web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

CreatedDateTime filter is not working on WorkflowTrackingStatusTable table

(0) ShareShare
ReportReport
Posted on by 1,542

Hi All,

I need to filter the data on “WorkflowTrackingStatusTable” on createddate time , date is getting from parameters using Transdate.

Written the code below for the same:

WorkflowTrackingStatusTable  wftst;

fromDate            = coming from parameters(parmFromDate)
todate              = coming from parameters(parmToDate)

utcFromDateTime     = DateTimeUtil::newDateTime(fromDate,0);
utcToDateTime       = DateTimeUtil::newDateTime(todate,86400); 

while select CreatedDateTime from wftst
where wftst.CreatedDateTime > utcFromDateTime
    && wftst.CreatedDateTime < utcToDateTime

{

}

The above code is getting out of the control, it is not going inside the loop.

 

Is there anything missing in the code, please advice.

Regards,

Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    240,171 Most Valuable Professional on at

    It must mean that there is no record for your parameters. What values do you have in fromDate and toDate variables? What record do you expect to meet the criteria? 

    I suggest you copy the actual SQL code generated from your X++ code and execute it directly against the database. This will ensure you work with the actual database data, which may be different from what you see in GUI (e.g. because of timezones) or what you expect to be produced by your code. 

  • Akbar Pasha Profile Picture
    1,542 on at

    Hi Martin,

    Fromdate is having ‘07/01/2025’ (1st July 2025)

    Todate → '07/31/2025' (31st July 2025)

     

    Records does exists for (07/04/2025) it is coming as 4th July 2025 - which is coming as 04/07/2025 when commented the fromdatetime and todatetime filter.

  • Martin Dráb Profile Picture
    240,171 Most Valuable Professional on at

    Now get the actual SQL code:

    select generateOnly forceLiterals CreatedDateTime from wftst
    where wftst.CreatedDateTime > utcFromDateTime
      && wftst.CreatedDateTime < utcToDateTime;

    info(wftst.getSqlStatement());

    share it with us and test it against your database.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 385 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 270

#3
Martin Dráb Profile Picture

Martin Dráb 243 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans