CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 clear date if value = Null or 0

Print topic Send  topic

Author Message
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
View profile  Send private message
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.
View profile  Send private message
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
View profile  Send private message
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/
> >
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.