 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rashid Guest
|
Posted: Fri Jan 02, 2004 11:18 am Post subject: Null values |
|
|
hi all,
i am trying to check for null values in date columns but without any luck.
Fields[0].AsDateTime <> 0 then
.........
If Fields[0] contains a date everything is ok. But if it contains null, then
i get an error.
how do i return a false value if fields[0] is a null value.
thanks in advance
rashid
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Fri Jan 02, 2004 11:35 am Post subject: Re: Null values |
|
|
Check the IsNull property for TField:
if Fields[0].IsNull then
<...>
--
With best regards, Mike Shkolnik
E-mail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
WEB: http://www.scalabium.com
"Rashid" <mra (AT) pacific (DOT) net.sg> wrote
| Quote: | hi all,
i am trying to check for null values in date columns but without any luck.
Fields[0].AsDateTime <> 0 then
.........
If Fields[0] contains a date everything is ok. But if it contains null,
then
i get an error.
how do i return a false value if fields[0] is a null value.
thanks in advance
rashid
|
|
|
| Back to top |
|
 |
Rashid Guest
|
Posted: Fri Jan 02, 2004 12:02 pm Post subject: Re: Null values |
|
|
thanks mike
but i still getting error after using your advice:
Project GATSSql.exe raised exception class EVariantInValudArgError with
message 'Invalid argument'.
I checked my data, only the records with the null values are giving this
problems.
any ideas?
rashid
"Mike Shkolnik" <mshkolnik2002 (AT) ukr (DOT) net> wrote
| Quote: | Check the IsNull property for TField:
if Fields[0].IsNull then
...
--
With best regards, Mike Shkolnik
E-mail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
WEB: http://www.scalabium.com
"Rashid" <mra (AT) pacific (DOT) net.sg> wrote in message
news:bt3j12$k4o$1 (AT) mawar (DOT) singnet.com.sg...
hi all,
i am trying to check for null values in date columns but without any
luck.
Fields[0].AsDateTime <> 0 then
.........
If Fields[0] contains a date everything is ok. But if it contains null,
then
i get an error.
how do i return a false value if fields[0] is a null value.
thanks in advance
rashid
|
|
|
| Back to top |
|
 |
Dan Guest
|
Posted: Fri Jan 02, 2004 7:53 pm Post subject: Re: Null values |
|
|
Have you stepped through this part of your program with the debugger?
Mike is right in using the IsNull test. Do you get the error when this
test is executed, or is it happening somewhere else?
Dan
On Fri, 2 Jan 2004 20:02:02 +0800, "Rashid" <mra (AT) pacific (DOT) net.sg>
wrote:
| Quote: | thanks mike
but i still getting error after using your advice:
Project GATSSql.exe raised exception class EVariantInValudArgError with
message 'Invalid argument'.
I checked my data, only the records with the null values are giving this
problems.
any ideas?
rashid
|
|
|
| Back to top |
|
 |
pr Guest
|
Posted: Sat Jan 03, 2004 4:49 am Post subject: Re: Null values |
|
|
"Rashid" <mra (AT) pacific (DOT) net.sg> wrote
| Quote: | thanks mike
but i still getting error after using your advice:
Project GATSSql.exe raised exception class EVariantInValudArgError with
message 'Invalid argument'.
I checked my data, only the records with the null values are giving this
problems.
any ideas?
rashid
|
You obviously do something with the date after you test for null.
Now, NULL is not a value but a *state* indicating *no value* which,
depending on the database engine you use, cannot be processed
like real field values. Some dbEngines may return 0 or '' for a null
field thus masking this.
PR
| Quote: | "Mike Shkolnik" <mshkolnik2002 (AT) ukr (DOT) net> wrote in message
news:bt3l7j$2m2e$1 (AT) news (DOT) dg.net.ua...
Check the IsNull property for TField:
if Fields[0].IsNull then
...
--
With best regards, Mike Shkolnik
E-mail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
WEB: http://www.scalabium.com
"Rashid" <mra (AT) pacific (DOT) net.sg> wrote in message
news:bt3j12$k4o$1 (AT) mawar (DOT) singnet.com.sg...
hi all,
i am trying to check for null values in date columns but without any
luck.
Fields[0].AsDateTime <> 0 then
.........
If Fields[0] contains a date everything is ok. But if it contains
null,
then
i get an error.
how do i return a false value if fields[0] is a null value.
thanks in advance
rashid
|
|
|
| Back to top |
|
 |
Jamie Guest
|
Posted: Sun Jan 04, 2004 7:37 am Post subject: Re: Null values |
|
|
you may want to try this first.
If assigned(Fields) Then If Fields[0].ASDateTime <> 0 then...
some of that way.
Rashid wrote:
| Quote: | hi all,
i am trying to check for null values in date columns but without any luck.
Fields[0].AsDateTime <> 0 then
.........
If Fields[0] contains a date everything is ok. But if it contains null, then
i get an error.
how do i return a false value if fields[0] is a null value.
thanks in advance
rashid
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|