Checking for null date

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Mar 29 13:50:08 CDT 2009


On 3/29/09 9:18 PM, "Steve Albin" <steve at steve-albin.com> wrote:

> I'm using V4RB 4 and I need to know how to tell if a date field in a cursor is
> null.  
> 
> I tried this:
> 
>   if VDateTime(cursor.Field(27)).Value <> nil then
>     Return  VDateTime(cursor.Field(27)).Value
>   else
>     Return nil
>   end
>  
> This returns a date field, but an invalid date which I would expect since I
> know the field is <NULL>.
> 
> I tried this:
> 
>   if  self.cursor.Field(27).GetString <> "" then
>     Return  VDateTime(cursor.Field(27)).Value
>   else
>     Return nil
>   end
>     
> This returns nil as expected.
> 
> I can easily change my code to check the string value, but it seems that the
> first way should work.  What am I doing wrong?

Much more easy

    if curs.Field(27).IsNull


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list