Page 1 of 1
Convert date format
Posted: Mon Oct 11, 2010 12:37 pm
by Creditevent
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.
Convert date format
Posted: Mon Oct 11, 2010 12:47 pm
by EViews Gareth
It isn't clear what you're trying to do. Could you provide more details/context?
Re: Convert date format
Posted: Mon Oct 11, 2010 1:07 pm
by Creditevent
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?
Re: Convert date format
Posted: Mon Oct 11, 2010 1:15 pm
by Creditevent
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?
Re: Convert date format
Posted: Mon Oct 11, 2010 1:18 pm
by Creditevent
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?
Re: Convert date format
Posted: Mon Oct 11, 2010 2:33 pm
by EViews Gareth
show @dateval(@str(yearmon),"YYYYMM")