Using a string as the last date in sample

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Lakey
Posts: 3
Joined: Tue Oct 14, 2014 5:19 pm

Using a string as the last date in sample

Postby Lakey » Sun Nov 16, 2014 10:08 pm

Hi

I have a string named 'lastqtr' that is derived from a dialogue box wherevy the user inputs the last date for their data in the format 'mm/dd/yy'. So, for example:

string lastqtr = 11/01/2014

I was wondering how I can then use this string to set the sample size of my workfile? I have tried stuff like this, but it doesn't seem to work:

smpl @first @lastqtr-20

I think this is because that EViews isn't recognising the string lastqtr as being in date format.

Any help would be greatly appreciated.

Thanks

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Using a string as the last date in sample

Postby trubador » Mon Nov 17, 2014 2:59 am

Code: Select all

string lastqtr = "11/01/2014" smpl @first {lastqtr}-20

Lakey
Posts: 3
Joined: Tue Oct 14, 2014 5:19 pm

Re: Using a string as the last date in sample

Postby Lakey » Mon Nov 17, 2014 3:55 pm

Many thanks, Trubador!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests