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

RE: Trouble with date object in while select statement

$
0
0

Hi Martin,

Apologies, that was a typo from copying and pasting code over to original message.

I'll provide code again with no typos and clear notes

str time = "20171001120005"; //example of time string being passed to method

provider = System.Globalization.CultureInfo::get_CurrentCulture();

datePattern = 'yyyyMMddhhmmss';

dt = System.DateTime::ParseExact(time, datePattern, provider);

select firstonly * from openRequestVw;

temp = openRequestVw.REQUEST_DELIVERY_TIME;

temp1 = DateTimeUtil::date(dt);

if (temp == temp1)

{

print("hello"); // this code gets hit as the dates are equal

}

while select * from openRequestVw

where openRequestVw.HUB_NAME == hubName && openRequestVw.REQUEST_DELIVERY_TIME == DateTimeUtil::date(dt)

{

// do stuff here

// this is not getting hit, the where clause doesn't evaluate the dates as equal for some reason

}

Thanks again,

Johnny


Viewing all articles
Browse latest Browse all 175888

Trending Articles



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