Formatting dates in reports

triona*
Member Posts: 27
Hi folks,
Im trying to figure out how to display all dates in certain reports ( just reports relating to our Irish site) in the following format dd-mmm-yy...but im new to navision and haven't a clue. I found a post saying to use something like the following:
textVariable := format(datefield,10,'<day,3>/<month,2>/<year>');
..problem is i don't even know where to type that!!
Can anyone give me the idiot proof answer to this question??
Thanks y'all,
triona*
Im trying to figure out how to display all dates in certain reports ( just reports relating to our Irish site) in the following format dd-mmm-yy...but im new to navision and haven't a clue. I found a post saying to use something like the following:
textVariable := format(datefield,10,'<day,3>/<month,2>/<year>');
..problem is i don't even know where to type that!!
Can anyone give me the idiot proof answer to this question??
Thanks y'all,
triona*
0
Comments
-
Hi Triona,
There are some standard ways of formatting the the date field. I would recommend searching the c/side reference guide with the key word "FORMAT".
This gives a very good explanation of how to use the format command for different data types including the DATE.
As for where to type it.....
Depends on how you want to use it ???? there are many options.
Hope that points you in the right direction.
Dean.Remember: Keep it simple0 -
thanks for the reply Dean!
im gonna take a look at that reference guide now....
what i was trying to figure out is, for a particular text box on say, the Sales Invoice report..when i go into the properties of the text box, can i type something directly into the Format field to change the date format just for that text box...dont want to change the format of the date field in the actual table where the date is stored....hope that makes some kind of sense :roll:
triona*0 -
Hi Triona,
Yep, makes perfect sense, done this with customers before
Lets use an example where the "location Code" on the sales header is used to define the Date format.
Lets assume there are 2 Location Codes
DMY (Day Month Year)
YMD (Year Month Day)
Create a new text variable:
MyNewText Type=Text Length =250
so your code would be something like:OnPreSection() ----------------- if "Location Code"=YMD then MyNewText:=Format("DateField",3) else MyNewText:=Format("DateField",0);
From the help file you will see that format 3 changes the date layout to be YMD(Year Month Date) and format 0 is the default date layout.
The way in which I would deal with this for my customers would be to create a new field on the Customer Card that specifies the format to be used. You can then get this each time you create a new sales order and transfer it at that point.
DeanRemember: Keep it simple0 -
Here’s idiot proof answer:
Open report in designer. Chose menu View / Sections. Select a field where your date is shown. Open properties window for this filed and enter following in Format property:<Day,2>-<Month Text,3>-<Year,2>
®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
perfect! thanks for all the replies
triona*0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K 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
- 320 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