Month name from a date

wolverine
Member Posts: 9
Hi,
Is it possible in navision to retreive the month name from a date.
For instance, I have the date 22/12/2005, I would like to copy 'december' in a variable.
Thanks.
Is it possible in navision to retreive the month name from a date.
For instance, I have the date 22/12/2005, I would like to copy 'december' in a variable.
Thanks.
0
Comments
-
-
Date
Format
Example
<Closing><Day,2>-<Month,2>-<Year>
0
05-04-03
<Closing><Day,2>-<Month,2>-<Year>
1
05-04-03
<Day,2><Month,2><Year><Closing>D
2
050403D
<Closing><Year>-<Month,2>-<Day,2>
3
03-04-05
<Closing><Day>. <Month Text> <Year4>
4
5. April 2003
<Closing><Day,2><Month,2><Year>
5
050403
<Closing><Year><Month,2><Day,2>
6
030405
<Day,2><Filler Character, >. <Month Text,3> <Year4>
7
5. Apr 2003
The following table below shows how these formats will change if the Regional and Language Options is set to "United States."
US Date
Format
Example
<Closing><Month,2>/<Day,2>/<Year>
0
04/05/03
<Closing><Month,2>/<Day,2>/<Year>
1
04/05/03
<Month,2><Day,2><Year><Closing>D
2
040503D
<Closing><Year>/<Month,2>/<Day,2>
3
03/04/05
<Month Text> <Closing><Day>, <Year4>
4
April 5, 2003
<Closing><Month,2><Day,2><Year>
5
040503
<Closing><Year><Month,2><Day,2>
6
0305040 -
Mark wanted to say:
MonthName := FORMAT(Date,0,'<Month Text>');
is the solution... ;-)1 -
Thanks Kamil.
Guess I should have taken more time for this post. :oops:
But somtimes it is more educational to puzzle your way out... O:)0 -
kine wrote:Mark wanted to say:
[...]
Now we know how he gets that high number of postings:
1. He writes a message giving just a hint
2. He writes a message giving an extract from the on-line help
3. He writes a message giving you the solution
So he writes 3 messages, instead of 1No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)1 -
Yes, and I post only posts about previous posts but only in simplier way... ;-)0
-
-
Luc Van Dyck wrote:Now we know how he gets that high number of postings0
-
Thanks. It works.
Merry Xmas. 8)0 -
wolverine wrote:Hi,
Is it possible in navision to retreive the month name from a date.
For instance, I have the date 22/12/2005, I would like to copy 'december' in a variable.
Thanks.
recDate of recpord-type DaterecDate.RESET; recDate.SETCURRENTKEY("Period Type","Period Start"); recDate.SETRANGE("Period Type",recDate."Period Type"::Month); recDate.SETRANGE("Period Start",datMydate - 50,datMyDate); recDate.FIND('+'); MESSAGE('%1',recDate."Period Name");
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!1 -
kriki wrote:
Another possibility is to use the Date-virtual table
Yeah, sure, and there is another possibility to write an OCX in assembly language that queries data from the observatory in Greenwich over the internet and guesses the current month from the status of the stars, and I am sure there are whole lot of other possibilities but isn't it simpler to just use FORMAT?
Date table is basically for matrix forms of the usual 1/7/31/12 etc. buttons, not very handy for determining current date and such...
Do It Yourself is they key. Standard code might work - your code surely works.0 -
Could you please post an example of that OCX O:)0
-
Shenpen wrote:Date table is basically for matrix forms of the usual 1/7/31/12 etc. buttons, not very handy for determining current date and such...
And I am not trying anymore since a few years, because I created my own functions to format numbers and dates with a format that is a lot easier to understand.
BTW : I would also like to see an example of that OCX =P~Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi,
I have done this for date name by creating the codeunit.
Name DataType Subtype Length
DateTable Record Date
InpDate Date
InpDate := TODAY;
DateTable.GET(DateTable."Period Type"::Date,InpDate);
MESSAGE(DateTable."Period Name");
and change like this for your requirement...
Thanks,
Rajasekar0
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