Convert Date Expression to DateFormula
                
                    spiky_golden                
                
                    Member Posts: 44                
            
                        
            
                    I have some difficulty to convert expression like "-CW" into a date formulavariable.  We are using both French and English environment so using "-CW" is cause quite a issue.
What I need to do is to calculate the first day of the current week. Then Find the first day and the last day of next week and the same thing for the week after.
1- I'm using "-CW " to get the first day of the current week.
2- I'm using "+1W" to get the first day of the next week from the date find in step 1
3- Then "+1W-1D" from the date find in step 2 and so on...
It is working great as long as the users don’t use the French version... I Read that using DateFormula variable will become language insensitive but I can't figure it out...
Any idea on how i can convert the code?
                What I need to do is to calculate the first day of the current week. Then Find the first day and the last day of next week and the same thing for the week after.
1- I'm using "-CW " to get the first day of the current week.
2- I'm using "+1W" to get the first day of the next week from the date find in step 1
3- Then "+1W-1D" from the date find in step 2 and so on...
It is working great as long as the users don’t use the French version... I Read that using DateFormula variable will become language insensitive but I can't figure it out...
Any idea on how i can convert the code?
0                
            Answers
- 
            To make the dateformulas international, use < and >. Example : '<1M>' or '<CW>'.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 - 
            
 - 
            spiky_golden wrote:I have some difficulty to convert expression like "-CW" into a date formulavariable. We are using both French and English environment so using "-CW" is cause quite a issue.
...
It is working great as long as the users don’t use the French version... I Read that using DateFormula variable will become language insensitive but I can't figure it out...
To assign to a DateFormula variable you need to use EVALUATE unless you have a value of type DateFormula already that is stored in some variable or field. C/AL does not provide any way to specify a DateFormula constant. So, all you can do is provide the formula as a string, which is language sensitive unless surrounded by < and > as kriki said.
Btw, CALCDATE takes a text, code or dateformula as its DateExpression parameter.0 - 
            In fact with the '<>' trick I don't even need dateformula. Everything works like a charm I just wish I had read the doc carefully as I just read it this morning... But hey, no one is perfect!0
 - 
            Let's throw in some Chinese ... euh ... informatics saying: When all else fails, try to read the <beeeeep> manual.
                        Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 
Categories
- All Categories
 - 73 General
 - 73 Announcements
 - 66.7K Microsoft Dynamics NAV
 - 18.7K 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
 - 617 NAV Courses, Exams & Certification
 - 2K Microsoft Dynamics-Other
 - 1.5K Dynamics AX
 - 323 Dynamics CRM
 - 111 Dynamics GP
 - 10 Dynamics SL
 - 1.5K Other
 - 990 SQL General
 - 383 SQL Performance
 - 34 SQL Tips & Tricks
 - 35 Design Patterns (General & Best Practices)
 - 1 Architectural Patterns
 - 10 Design Patterns
 - 5 Implementation Patterns
 - 53 3rd Party Products, Services & Events
 - 1.6K General
 - 1.1K General Chat
 - 1.6K Website
 - 83 Testing
 - 1.2K Download section
 - 23 How Tos section
 - 252 Feedback
 - 12 NAV TechDays 2013 Sessions
 - 13 NAV TechDays 2012 Sessions
 
