[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Dates in local procedures
- Subject: Re: Dates in local procedures
- From: "Kloprogge, F.J.M. (Frank)" <F.J.M.Kloprogge@FONTYS.NL>
- Date: Fri, 6 Oct 2000 15:42:23 +0200
It might be simpler if you would convert dates to YYYYMMDD-format.
In that case, you can compare dates as strings as well .
i.e. in oracle:
alter session set nls_date_format='YYYYMMDD'
-----Oorspronkelijk bericht-----
Van: Ed Kelly [mailto:ed_kelly@HOTMAIL.COM]
Verzonden: vrijdag 6 oktober 2000 0:42
Aan: SQR-USERS@LIST.IEX.NET
Onderwerp: Dates in local procedures
How do you get SQR to treat a local variable as a date? It looks like dates
passed to a local variable are converted to string. Here's a code
fragments:
Begin-Setup
Declare-variable
Date $Fromdate $Thrudate
End-Declare
End-Setup
. . . . . .
Begin-Procedure Main
Let $FromDate = StrToDate('Jan 01 1995','Mon dd, YYYY')
Let $ThruDate = StrToDate('Aug 01 1995','Mon dd, YYYY')
If $FromDate > $ThruDate
Show 'Test1: From date is greater than Thru date' ! Does not display
End-if
Do Test ($Fromdate, $ThruDate)
End-Procedure
Begin-Procedure Test($From, $Thru)
If $FromDate > $ThruDate
Show 'Test2: From date is greater than Thru date' ! Does display
End-if
End-Procedure
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.