Convert date string to date value

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Convert date string to date value

Postby vivienle » Mon Apr 27, 2015 10:56 am

Hello,
I'm trying to convert a date string in the format of 1999M02 (date string obtained from: smpl if seriesX <> na, %firstdate = @otods(1)) to a date value. Could you please help? I've been looking and googling but can't figure out how.
Thanks,
vivien

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Convert date string to date value

Postby EViews Gareth » Mon Apr 27, 2015 11:19 am

@dateval

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Convert date string to date value

Postby vivienle » Mon Apr 27, 2015 11:24 am

Hello,
I did look at @dateval. But I need to provide the format of the date string and I don't know what I'm supposed to use as formats shown in the manual are all in normal date formats such as "mm/dd/yyyy", "month dd, yyyy".
So, @dateval("1999M02", "what do I put in here?")
Thanks,
vivien

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Convert date string to date value

Postby EViews Gareth » Mon Apr 27, 2015 11:37 am

You can leave the second argument blank. EViews will figure it out.

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Convert date string to date value

Postby vivienle » Mon Apr 27, 2015 11:45 am

Thanks! It works!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests