Hi!!!
I have one field(datatype=code) named Period. If it has value as 2016_01 then I need to get the First Date of January of that year i.e 01/01/2016, if it is 2015_08 then 01/08/2015, this way. How can I do that? any suggestion?
Thanks in advance..
0
Answers
The format of this 2016_01 will always be same OR it may change something like 01_2016 or it will always be in this format 2016_01?
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Is it that solutuon you would like to have?
Datestr2:=CONVERTSTR(Datestr, '_', ',');
evaluate(dateVar,strsubstno('01/%2/%3',SELECTSTR(2, Datestr2),SELECTSTR(1, Datestr2));
you will have required date in dateVar.
Reports transformation to RDLC
List -1h , Complex List -3h, Document -4h (dev hours)
navisionupgrade.com
evaluate(Year, copystr(datestr,1,4));
evaluate(Month, copystr(datestr,6,2));
Datevar := DMY2Date(1,month,year);
Use this code
DateValue := '2018_12';
Year := COPYSTR(DateValue,1,4);
Month := COPYSTR(DateValue,6,7);
EVALUATE(NewMonth,Month);
EVALUATE(NewYear,Year);
NewDate := DMY2DATE(1,NewMonth,NewYear);
NewDate will have the desired result.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Thanks for your repiles.
@RockWithNAV : I got it working following your step. Thanks. My code is as followed and it is working fine.
IF RecABC.FINDFIRST THEN BEGIN
year := COPYSTR(RecABC."Invoicing Period",1,4);
month := COPYSTR(RecABC."Invoicing Period",6,7);
EVALUATE(DateFrom,'01'+'/'+month+'/'+year);
DateTo := CLOSINGDATE(DateFrom);
END
Invoicing Period = 2016_01,2016_02..this way..
o/p: DateFrom = 01/01/2016 and DateTo = 31/01/2016.
Thank you guys..