Convert date format
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
Creditevent
- Posts: 6
- Joined: Mon Oct 11, 2010 12:18 pm
Convert date format
Can anyone help me converting a text format (like 200101) into a date format (YYYYMM). It is possible in Excel with the command: "Datevalue". The problem in Eviews is that if am just using "properties - period - date format: YYYY:MM" it is not reading the month and year correctly.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Convert date format
It isn't clear what you're trying to do. Could you provide more details/context?
-
Creditevent
- Posts: 6
- Joined: Mon Oct 11, 2010 12:18 pm
Re: Convert date format
Thank you for looking at the issue. I will try be more clear. I want to tell Eviews that my the variable "YR" is a date (not a number). I was trying to do that in "properties" -> "period" and "date format = YYYYMon". However Eviews reads 200101 as "0549Feb" - which is wrong (it should be year 2001 and January). Excel does the same mistake - but I can correct this issue by another command. Can Eviews do something similar? Do you follow my problem?
It isn't clear what you're trying to do. Could you provide more details/context?
-
Creditevent
- Posts: 6
- Joined: Mon Oct 11, 2010 12:18 pm
Re: Convert date format
Thank you for looking at the issue. I will try be more clear. I want to tell Eviews that my the variable "YR" is a date (not a number). I was trying to do that in "properties" -> "period" and "date format = YYYYMon". However Eviews reads 200101 as "0549Feb" - which is wrong (it should be year 2001 and January). Excel does the same mistake - but I can correct this issue by another command. Can Eviews do something similar? Do you follow my problem?It isn't clear what you're trying to do. Could you provide more details/context?
- Attachments
-
- eviews.wf1
- (8.51 KiB) Downloaded 547 times
-
Creditevent
- Posts: 6
- Joined: Mon Oct 11, 2010 12:18 pm
Re: Convert date format
Thanks. In the attached file you see the variable "yearmon" e.g. "200101" - but Eviews reads "200101" not as "year 2001 and January" but something way different. Can you help me having Eviews reading "200101" as "2001 and January"?
Thank you for looking at the issue. I will try be more clear. I want to tell Eviews that my the variable "YR" is a date (not a number). I was trying to do that in "properties" -> "period" and "date format = YYYYMon". However Eviews reads 200101 as "0549Feb" - which is wrong (it should be year 2001 and January). Excel does the same mistake - but I can correct this issue by another command. Can Eviews do something similar? Do you follow my problem?It isn't clear what you're trying to do. Could you provide more details/context?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Convert date format
show @dateval(@str(yearmon),"YYYYMM")
Who is online
Users browsing this forum: No registered users and 2 guests
