Welcome! Log In Create A New Profile

Advanced

How detect empty DateTime Field

Posted by Michael Drechsel 
Michael Drechsel
How detect empty DateTime Field
June 16, 2009 10:59AM
Hi,

how can I detect an empty DateTime Field ?

I guess datetime<>"" doesn&acute;t work.

In Foxpro we had the empty() function, but in WD I can&acute;t find something similar.

Stefan Bentvelsen
Re: How detect empty DateTime Field
June 16, 2009 11:04AM
Hi Michael,

look in the Help for Datevalid()
ICI
Re: How detect empty DateTime Field
June 16, 2009 11:04AM
You can into description on that edt_box enable option "Mandatory".
It is easy way. Offcourse you can do that also by code.
Michael Drechsel
Re: How detect empty DateTime Field
June 16, 2009 11:15AM
Hi,

it&acute;s a query field, not a edit_box.
Michael Drechsel
Re: How detect empty DateTime Field
June 16, 2009 11:40AM
Doesn&acute;t work for a datetime field.
ICI
Re: How detect empty DateTime Field
June 16, 2009 11:42AM
If you use query and don't pass parameter DATE, mean ( Empty(Date()) , like in foxpro)
Query will ignore that parameter. Query ignore empty parameters and uses only parameters with values.

MyDate..year
MyDate..Day
MyDate..Month

are options to see any value of your date
or maybe
IF MyDate..Empty = True THEN
.......Info("My Date is empty")
ELSE
.......Info("My Date is filled")
END
Michael Drechsel
Re: How detect empty DateTime Field
June 16, 2009 12:04PM
And this also don&acute;t work for a datetime field.

property "empty" not exist ....


I need it for the following case:


for all qry_whatever

if empty(qry_whatever.datetime)=true then

noDateAndTime++

end

any ideas else ???
Louis Verbraak
Re: How detect empty DateTime Field
June 16, 2009 12:14PM
Hello Michael,

Perhaps you can make your own procedure where you split the datetime in a date and a time. There you can check these values and return true or false.

HTH.
Michael Drechsel
Re: How detect empty DateTime Field
June 16, 2009 12:17PM
Solved:

if qry_whatever.datetime=stringtodate("00000000000000") then

noDateAndTime++

end


Note nice, but it seems to be work.

thx @all
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: