Re: Can we rely on CTOD()'s empty date feature?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mike McDowall (m.a.mcdowall_at_ed.com)
Date: 03/25/05


Date: Fri, 25 Mar 2005 07:39:57 +0000

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:
>
>> 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().
You call that _more_ strict ? When it is totally inconsistent ?

> Plus, I am
>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.
I use CTOD() in precisely this fashion, VFP5 and 8, no problem.

Mike.



Relevant Pages