[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: How To Validate Date In SQR
- Subject: Re: How To Validate Date In SQR
- From: Ray Ontko <rayo@ontko.com>
- Date: Mon, 7 Apr 1997 22:18:29 -0500
- In-Reply-To: <9704041355.AA11874@sdtdev> from Mogullapalli Sridhar at "Apr 4, 97 05:55:12 am"
> Hi Shiv,
>
> Thanks for reply. Actually i am using Sybase SQR. When we run our report
> the format comes like ...
>
> ********************************************************************************
> SQR: Structured Query Report Writer VX.XXX
> Copyright (C) XXXX-XX SQ Software All Rights Reserved
>
> Enter end date (ccyymmdd):
> ********************************************************************************
>
> Here we have to validate the date. Suppose if the user enter date like
> 19970230, then i have to inform that , it is not a validate date.
You might try something like this:
input $my_date
begin-select on-error=my_error_proc
convert(datetime,$my_date) &dummy
end-select
begin-procedure my_error_proc
show 'error in date format'
end-procedure
----------------------------------------------------------------------
Ray Ontko | Ray Ontko & Co | "Time for a new signature line."
rayo@ontko.com | Richmond, In | See us at http://www.ontko.com/