[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



> 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/