Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

How to pass lesser than created date range in query class

$
0
0

Hi,

I want to pass a 'CreatedDateTime' range value to a query in runtime to delete a table records which has the 'CreatedDateTime' value lesser than the parameter value that is been passed as query range value.

When the parameter value is been fetched, it is in the correct format of '9/27/2017 11:30:44 am'. But when I pass the same to query range using the below syntax, it is getting converted to the format '2017-09-27T15:31:48' which is not making the query to select the records properly.

utcDateTime         createdDateTime;

createdDateTime= dataContract.parmFromDate(); //This returns utcDateTime value - 9/27/2017 11:30:44 am

 

queryBuildrange = query.dataSourceTable(tableNum(TestTable)).addRange(fieldNum(TestTable, CreatedDateTime));
queryBuildrange.value(strFmt('<%1', createdDateTime)); //This adds the range value as 2017-09-27T15:31:48

Any suggestions pls!

Thanks!

 


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>