Page 1 of 1

Using a string as the last date in sample

Posted: Sun Nov 16, 2014 10:08 pm
by Lakey
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

Re: Using a string as the last date in sample

Posted: Mon Nov 17, 2014 2:59 am
by trubador

Code: Select all

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

Re: Using a string as the last date in sample

Posted: Mon Nov 17, 2014 3:55 pm
by Lakey
Many thanks, Trubador!