[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: DateAdd / StrToDate problem.
- Subject: Re: DateAdd / StrToDate problem.
- From: Peter Clark <PGCLARK@VAC-ACC.GC.CA>
- Date: Thu, 10 Jan 2002 09:34:43 -0400
You need to declare $TempDate as a date variable and build your string date in
a different variable i.e.
begin-setup
declare-variable
date $TempDate
end-declare
end-setup
then
Let $MyMonth = '200111'
Let $TempDateIn = $MyMonth || '01'
Let $TempDate = strtodate($TempDateIn, 'YYYYMMDD')
Let $TempDate = DateAdd($TempDate, 'month', -6)
Let $HalfYear = DateToStr($TempDate, 'YYYYMM')
>>> Jarrodb <jarrodb@NETSPACE.NET.AU> 2002/01/10 8:23:56 am >>>
Hi all!
Hoping someone can help.
I am trying to use the dateadd as seen below but are
getting the following errors.
Any tips would be greatly appreciated,
thanx.
Let $MyMonth = '200111'
Let $TempDate = $MyMonth || '01'
Let $TempDate = strtodate($TempDate, 'YYYYMMDD')
Let $TempDate = DateAdd($TempDate, 'month', -6)
Let $HalfYear = DateToStr($TempDate, 'YYYYMM')
Error on line 78:
(SQR 4045) Function or operator 'dateadd' requires date argument.
Error on line 79:
(SQR 4045) Function or operator 'datetostr' requires date argument.
Errors were found in the program file.
SQR: Program Aborting.