Thursday, July 18, 2019

How to Get Start Date and End Date from a Date (SystemDateGet())

How to  Get Start Date and End Date from a Date

utcDateTime fromDateTime,toDateTime;

fromDateTime= DateTimeUtil::newDateTime((DateStartMth(SystemDateGet())),str2time("00:00:00.000 AM"),DateTimeUtil::getUserPreferredTimeZone());


    toDateTime= DateTimeUtil::newDateTime((endmth(SystemDateGet())),str2time("23:59:59.000 PM"),DateTimeUtil::getUserPreferredTimeZone());

You can build a date range where fromDateTime is starting date of a month and toDateTime is ending date of a month.

Thanks
Uma

No comments:

Post a Comment

using SQL Query in X++

 If you need to execute sql query inside your X++ code then below example can help you. To pass value to SQL query we need to use strfmt() f...