@dateadd error

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

@dateadd error

Postby ErikG » Mon Jan 29, 2018 1:37 am

Code: Select all

WfCreate C:\temp\temp.wf1 m 1980 2020
!da = @DateAdd(736722,1,"mm")
@UiPrompt(@Str(!da))


Returns NA

Other numbers such as 3000 work fine.

Eviews 10 jan 17 2018 build

Regards
/Erik

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: @dateadd error

Postby ErikG » Mon Jan 29, 2018 2:01 am

I now see that this has to do with the current date: 29th of january. Since the 29th of february does not exist, @dateadd returns NA. I will write up a workaround:

Code: Select all

If !da = Na Then
   !da = @DateAdd(736722,15,"dd")
EndIf

dman
Posts: 24
Joined: Mon Jul 18, 2016 10:50 am

Re: @dateadd error

Postby dman » Wed Jan 31, 2018 10:01 am

Ran into a similar issue today 01/31/2018.
I'm not adding days, but subtracting them off @now. As long as the target month is 31-days long it works. For 30-day months it doesn't.

Code: Select all

@datestr(@dateadd(@dateval("1/31/2018"),-4,"mm"),"yyyy[q]q")

results in "?"

substituting -4 to -1 (so that the result is December'17) works.


Seems like a bug alright.

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

Re: @dateadd error

Postby EViews Gareth » Wed Jan 31, 2018 10:19 am

Not a bug - same issue as before.

You're taking 4 months from January 31st. That equals September 31st. There is no such thing as September 31st, so the result is not available.
Follow us on Twitter @IHSEViews


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests