DateFormula................
Angelo
Member Posts: 180
Hello,Master
I wanna ask small question :
I have variable "periodLength " type dateformula.
then, I want to use calcdate for calculate date :
periodStartdate := calcdate(periodlength,WORKDATE);
if I fill periodlength ==> 1M
I want to 'calcdate' 1 month ago by coding :
periodStartdate := calcdate(-periodlength,WORKDATE); or
periodStartdate := calcdate('-periodlength',WORKDATE);
it will show error message,How I can use dateformula by using prefix 'minus' ?
please help me...... ](*,)
I wanna ask small question :
I have variable "periodLength " type dateformula.
then, I want to use calcdate for calculate date :
periodStartdate := calcdate(periodlength,WORKDATE);
if I fill periodlength ==> 1M
I want to 'calcdate' 1 month ago by coding :
periodStartdate := calcdate(-periodlength,WORKDATE); or
periodStartdate := calcdate('-periodlength',WORKDATE);
it will show error message,How I can use dateformula by using prefix 'minus' ?
please help me...... ](*,)
0
Comments
-
EVALUATE(PeriodLength,'-1M');
PeriodStartDate := CALCDATE(PeriodLength,TODAY);
Greats
Frank0 -
Sorry,Frank,maybe there is misunderstanding..
I make a control textbox with souce expresion "periodlength" type dateformula,so user can fill it : 1Y,1M,2W,so on(periodlength is dynamic). afterwards,I want to use the variable(periodlength) for calculate date by using CALCDATE. if user fill it : "1M", when I calculate it, I want to calculate as "-1M" for assigning to periodstartdate like this :
periodStartdate := calcdate(-periodlength,WORKDATE); or
periodStartdate := calcdate('-periodlength',WORKDATE);
but error.....
What should I have to do for solving my problem above?
anyone can give me advice? [-o<
regards,
Angelo....0 -
calcdate(STRSUBSTNO('-%1', periodlength),WORKDATE)
but it will work incorrect if you enter dataformula like 1Y+2MVirginijus0 -
DF - DateFormula (input from form)
D - Date (input from form)
RD - Date (result date)
If DF would such as '1D' or '1M' then
RD := CALCDATE('-'+FORMAT(DF),D);
THE BEST WAY:
But if DF is for example '1M+1D-1W' then
RD := CALCDATE(DF,D);
RD := D - (RD-D);
It works. I cheked.0 -
THE BEST WAY:
But if DF is for example '1M+1D-1W' then
RD := CALCDATE(DF,D);
RD := D - (RD-D);
My error. This counts days. Error can apears when month with diferent days (28.29.30.31)
So may be it wil work:RD := CALCDATE('-('+FORMAT(DF)+')',D);0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions