Re: Can we rely on CTOD()'s empty date feature? by Gene
Gene
Thu Mar 24 14:30:37 CST 2005
On Thu, 24 Mar 2005 17:24:31 GMT, trw7at@ixdot.netcomdotcom (Tim
Witort) wrote:
>Gene Wirchenko seemed to utter in news:fan341lqqogjg8dsll2e6pn44539mqa33k@
>4ax.com:
[snip]
>> I was going to suggest using date() but
>> ? date(2005,13,1) && error
>> ? date(2005,11,31) && NO error: prints empty date
>> ? date(10000,11,31) && error
>
>Yeah, DATE() is much more strict than CTOD(). Plus, I am
But not strict enough.
At least, it is not that stupidity in JavaScript where
.getMonth() returns one less than the month number. Off-by-one error,
anyone?
>starting with a character date. It's much more convenient
>to feed that to CTOD() than to parse out the year, month,
>and day as numeric values. CTOD()'s returning an empty
>date on a bogus date is almost more useful than it's
>intended function! It's like having an ISDATE() function
>for strings. You just need to fiddle with the STRICTDATE
>setting whenever you use it to avoid the warnings.
Put a wrapper around it?
Sincerely,
Gene Wirchenko