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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Query range function: Less than date and not date null

PA-22040759-0 Profile Picture PA-22040759-0 6,194
There is a lessThanDate query function in AX, but it also select blank dates.

Here is a suggestion for a similar function, that does not include the blank dates:
public static str lessThanDateAndNotNull(int relativeDays = 0) 
{     
    utcdatetime  currentDateTime;      

    currentDateTime = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), 
                                                        DateTimeUtil::getUserPreferredTimeZone());      

    return SysQuery::value(dateNull() + 1) + ' .. ' +            
           SysQuery::value(DateTimeUtil::date(DateTimeUtil::addDays(currentDateTime, relativeDays - 1)));  
}

Comments

*This post is locked for comments