[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: dateadd problem
That was the problem...Thanks for all your help!
B
The Programmer formally known as Bob
Mediware Information Systems Inc.
(913) 307-1045
Bob.Helm@Mediware.com <mailto:Bob.Helm@Mediware.com>
-----Original Message-----
From: Joy Hoyte [mailto:JoyHoyte_sqr@hotmail.com]
Sent: Thursday, April 05, 2001 12:09 PM
To: Bob.Helm@MEDIWARE.COM
Subject: Re: dateadd problem
Just checking...you did declare $run_day, $chart_for_date, etc. all as date
variables, yes?
Joy Hoyte
----- Original Message -----
From: "Bob Helm" <Bob.Helm@MEDIWARE.COM>
To: <SQR-USERS@list.iex.net>
Sent: Thursday, April 05, 2001 12:44 PM
Subject: dateadd problem
> I have a problem that should be easy to fix, but I'm stuck.
>
> I simply want to add 2 months to a date. My code is as follows:
>
> let $run_day = edit(Datenow(),'DD')
> if $run_day != '05'
> let $chart_for_date = dateadd(datenow(),'month',1)
> print $chart_for_date (+1,1) edit 'Month YYYY'
> else
> let $chart_for_date = Datenow()
> print $chart_for_date (+1,1) edit 'Month YYYY'
> end-if
>
> let $chart_thru_date = dateadd($chart_for_date,'month',2)
> print $chart_thru_date (+1,1)
>
> When I try to run I get the following error message:
>
> Error on line 282:
> (SQR 4045) Function or operator 'dateadd' requires date argument.
>
> As you can see, if I use Datenow() for the date value, it works.
Otherwise,
> I get the error
> and am having to write unnecessary lines of code.
>
>
> Thanks a ton,
>
> B
> The Programmer formally known as Bob
> Mediware Information Systems Inc.
> (913) 307-1045
> Bob.Helm@Mediware.com
>