AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.03.2012, 01:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
It does compile without errors. But does it also run without errors?

datshipmentdate := 01072012D;

intDateDec := 9999;

intDateDec := (CREATEDATETIME(”datShipmentdate”, 0T) - CREATEDATETIME(010180D, 0T)) / 86400000;

MESSAGE(’%1′,intDateDec);

I’ll give the SQL answer (even if SQL has nothing to do with it): it depends.

It works on 4.0SP3 Build 25638,5.0SP1 Build 26084.

It gives an error on 5.0SP1 Build 30488,NAV2009 build 27808,NAV2009SP1 build 29227,NAV2009R2 32228

The error is:

Overflow under type conversion of Decimal to Integer.

Value: 11,869.9583333333333

Other builds I didn’t try, but it is clear that between builds 26084 and 30488 something has changed internally in C/AL.

In the older versions, the result is implicitly converted to an integer but not anymore in the newer versions.

These are 2 versions that work:

datshipmentdate := 01072012D;

intDateDec := 9999;

intDateDec := ROUND((CREATEDATETIME(”datShipmentdate”, 0T) - CREATEDATETIME(010180D, 0T)) / 86400000,1);

MESSAGE(’%1′,intDateDec);

or also:

datshipmentdate := 01072012D;

intDateDec := 9999;

intDateDec := (CREATEDATETIME(”datShipmentdate”, 0T) - CREATEDATETIME(010180D, 0T)) DIV 86400000;

MESSAGE(’%1′,intDateDec);



Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 04:22.