travel-net
Posts: 56
|
| Posted: 09/16/2004, 1:32 AM |
|
Hello,
I wan't to clear a date label if the value = NULL or 0.
This is my code.
if ($facturatie->einde_abodatum->GetValue() == "0000-00-00") {
$facturatie->einde_abodatum->SetValue("");
} else if ......
The problem is that i can't get it to work if label is set to date. With the label set to text it is working.
Date label format: dd-mm-yyyy
Database format: yyyy-mm-dd HH:nn:ss
Mysql 4.0.18
Regards,
Frans
|
 |
 |
klw
|
| Posted: 09/16/2004, 9:33 AM |
|
I've had better luck dealing with dates as strings when it's possible.
In this case, it looks like you're using a timestamp field - I always
treat these as text.
|
|
|
 |
travel-net
Posts: 56
|
| Posted: 09/17/2004, 1:48 AM |
|
Yes, i know. Unfortunately i must use date and timestamp.
|
 |
 |
Nicole
Posts: 586
|
| Posted: 09/17/2004, 2:27 AM |
|
Hello,
It is related to CCS function toSQL() from clsDBconnection_name class from Common.php. Look at it and you’ll see that it returns "NULL" value for empty values. You can modify this function to return empty string for empty dates.
_________________
Regards,
Nicole |
 |
 |
DonB
|
| Posted: 09/21/2004, 2:32 PM |
|
You might get away with just setting the Label to "Date" datatype. I
suspect that the field will be left blank if it's not a legitimate date
value.
--
DonB
http://www.gotodon.com/ccbth
"travel-net" <travel-net@forum.codecharge> wrote in message
news:5414aa4f04a471@news.codecharge.com...
> Yes, i know. Unfortunately i must use date and timestamp.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
DonB
|
| Posted: 09/21/2004, 2:33 PM |
|
Actually I see that you set it to date. Oh well.
--
DonB
http://www.gotodon.com/ccbth
"DonB" <~ccbth~@gotodon.com> wrote in message
news:ciq6ls$sih$1@news.codecharge.com...
> You might get away with just setting the Label to "Date" datatype. I
> suspect that the field will be left blank if it's not a legitimate date
> value.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "travel-net" <travel-net@forum.codecharge> wrote in message
>news:5414aa4f04a471@news.codecharge.com...
> > Yes, i know. Unfortunately i must use date and timestamp.
> > ---------------------------------------
> > Sent from YesSoftware forum
> > http://forums.codecharge.com/
> >
>
>
|
|
|
 |