Good day House. Please I am facing a challenge now. I have to assign a "Date" Value to a "DateTime" variable. How do I convert the "Date" to a "DateTime"?
Thanks for your help.
*This post is locked for comments
Good day House. Please I am facing a challenge now. I have to assign a "Date" Value to a "DateTime" variable. How do I convert the "Date" to a "DateTime"?
Thanks for your help.
*This post is locked for comments
DateTime := CREATEDATETIME(Date, Time)
Hi Toffsam,
I replied your email and also added your Skype.
I'm looking for a Remote or Part-Time Position. I have 6 hours/day available and would like to provide it to any company looking for NAV experience person.
Hi Khoa,
I sent you an email on this Remote/Part-Time Position.
Thanks.
You are welcome, have a nice day!
Thanks Khoa. It works.
Hi Toffsam,
Change a little bit your code:
varEndDate := CREATEDATETIME(CALCDATE('CM', EndDate), 0T);
SETFILTER(LastDayMonth, '<=%1', varEndDate);
Hi Toffsam,
Totally agree with Stefano:
"YourDateTime := CREATEDATETIME(YourDate,0T);"
Another way is:
IF EVALUATE(YourDateTime, FORMAT(YourDate)) THEN;
I think that the problem is in the CALCDATE function. The second parameter must be a Date value.
Hi Demiliani,
thanks for your reply. Yes I tried that before but still could not achieve my aim . What I really want to achieve is setfilter on a DateTime field in a table, now the value to setfilter with is a Date value and am getting error: Conversion is not possible Date:= DateTime.
This is my code:
varEndDate := CREATEDATETIME(EndDate,0T);
SETFILTER(LastDayMonth,'<=%1',CALCDATE('CM', varEndDate));
Note: "LastDayMonth" is a DateTime field from the record(Table) which holds last day of
month for a date.
"EndDate" is a Date value coming from Request page
"varEndDate" is the DateTime variable i am assigning my converted date value so I
can setfilter on my record.
I get the error on the SETFILTER(LastDayMonth,'<=%1',CALCDATE('CM', varEndDate)); lin e that "Conversion is not possible because 1 of the operators contain an invalid type. Date:= DateTime."
Please how can I achieve this filter.
Thanks again.
You can do like this:
YourDateTime := CREATEDATETIME(YourDate,0T);
Community Member
2
EH-09052238-0
1
Sohail Ahmed
1