Report- Format Date MMYY
fredp1
Member Posts: 86
Hi,
How do I format a field on a report to show in a MMYY format instead of DDMMYY?
Thanks
Fred
How do I format a field on a report to show in a MMYY format instead of DDMMYY?
Thanks
Fred
0
Comments
-
this is one way:
txtYear := FORMAT(DATE2DMY(TODAY,3) MOD 100); txtMonth := FORMAT(DATE2DMY(TODAY,2) MOD 100); IF strlen(txtyear) = 1 then txtyear := '0' + txtyear; IF strlen(txtmonth) = 1 then txtmonth := '0' + txtmonth; txt := txtMonth + '/' + txtYear;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
or this method:
format(mytable."posting date",0,'<Month,2>/<Year,2>')
@kriki: :? can you explain your code to us little terrains?
i understood, but...are you joking or i am not smart enough?It's a quite hard coded method, is there a particular reason to use your method instead of mine?0 -
That after 10 years of NAV, I still can't use the format string of NAV :whistle:Belias wrote:or this method:format(mytable."posting date",0,'<Month,2>/<Year,2>')
@kriki: :? can you explain your code to us little terrains?
i understood, but...are you joking or i am not smart enough?It's a quite hard coded method, is there a particular reason to use your method instead of mine?
Maybe also because I created my own that is a lot easier to use (it is based on the Progress format string).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
eheh...i've had to press F1 to remember how to format like this :whistle:kriki wrote:
That after 10 years of NAV, I still can't use the format string of NAV :whistle:Belias wrote:or this method:format(mytable."posting date",0,'<Month,2>/<Year,2>')
@kriki: :? can you explain your code to us little terrains?
i understood, but...are you joking or i am not smart enough?It's a quite hard coded method, is there a particular reason to use your method instead of mine?
Maybe also because I created my own that is a lot easier to use (it is based on the Progress format string).
it's incredibely difficult to remember all the faces of this function
0 -
And it is difficult to use, with long formatting strings.Belias wrote:eheh...i've had to press F1 to remember how to format like this :whistle:
it's incredibely difficult to remember all the faces of this function
If I want a date, I do this:
DD/MM/YYYY for European format
MM/DD/YYYY for US format
YYYY/MM/DD for best format
YYYYMMDD for a format I can easily convert in an integer.
And I can also use MMMMMM to write the month completely. Or M######### to remove blanks for "May".Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi
I know that I also had a lot of trouble with the FORMAT statement but dates are pretty simpleFORMAT("Posting Date",0,'<Day>/<Month>/<Year>'); gives 1/01/09 dd/mm/yy FORMAT("Posting Date",0,'<Day>/<Month>/<Year4>'); gives 1/01/2009 dd/mm/yyyy FORMAT("Posting Date",0,'<Day> <Month Text> <Year>'); gives 1 January 09 FORMAT("Posting Date",0,'<Day> <Month Text,3> <Year4>'); gives 1 Jan 2009
Hope this helps a bit with the frustrations
Albert0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 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