Re: Validate a date ? - Illustra Web Blade
Posted in 1997
Topics: General Discussion
moore <mmoore@antares.Tymnet.COM> writes: >I am using Illustra with Web Data Blade. It seems that there is >no easy way to accept a date from a web page and determine >if it is a valid date. (Apply a date edit). >I would expect a $(ISDATE,value) function but there is none. >Also there seems to be no date validation function in the >Illustra User's Guide. >Am I missing something? It seems to me that this is pretty >basic! What is the best way to validate a date. You could set up an <?MIERROR> tag to catch an exception, then try something like <?MiSQL SQL="return $datefld::date;" ERROR=DateErr>. However, I think a real problem is wanting users to obediently enter SQL-allowable dates; Whatever you say on the page, they will always want to type in a date in their own format, and then say your page is unfriendly if/when it complains! If you know C, try writing a function (say ReturnDate) to take their text, try to understand it, and return it in legal-SQL-text (it's a bit difficult to actually return a date in binary), and then use (say): insert .... values (ReturnDate($datefld)::date, ....) Good Luck, Rob