This topic is locked
[SOLVED]

 Hide Null Values

5/19/2010 1:39:36 PM
PHPRunner General questions
swant author

I built a report based on dates. some fields have no value which causes in my report to report a NULL value. I want to hide that to be blank or add a default value to a number like 0. Support suggested using php custom code but i am not that good and cant find how to do this on any site. I found how to change the cells color to a color but it makes it a solid color even if it has a value. Any suggestions would be helpful.
forgot to mention that i can set default value in mysql and still shows null value so im guess php is reporting that?

A
ann 5/20/2010

Hi,
to add a default value use SQL mode on the Edit SQL query tab. Here is a sample for MySQL:

SELECT

...

if (FieldName is NULL,0,FieldName)as FieldName,

...

FROM TableName
swant author 5/20/2010

I cant get your statement to work. Also i am wondering if i can add if null for released to prod to equal now. you said to add to sql staement would i actual add that to custom php?
SELECT

Name of Careset,

Build or Maintain,

Owner,

Date Build Requested,

Department Approval,

Compliance Approval,

Lab Approval,

Pharmacy Approval,

Quality Approval,

Radiology Approval,

Released to Prod,

DATEDIFF(Released to Prod, Date Build Requested) AS Days in Build Status

FROM List Of Needs

WHERE (Build or Maintain ="Build")



Hi,
to add a default value use SQL mode on the Edit SQL query tab. Here is a sample for MySQL:

SELECT

...

if (FieldName is NULL,0,FieldName)as FieldName,

...

FROM TableName


A
ann 5/20/2010

Hi,
Please see my comments below:

  • i am wondering if i can add if null for released to prod to equal now Here is a sample for Mysql:

`Radiology Approval`,

if (`Released to Prod` is NULL,now(),`Released to Prod`)as `Released to Prod`,

DATEDIFF(`Released to Prod`, `Date Build Requested`) AS `Days in Build Status`


  • I cant get your statement to work. Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.
  • you said to add to sql staement would i actual add that to custom php? I'm not sure that I fully understand you. Could you re-phrase it?

swant author 5/20/2010

I found out my answer on my own for blanking the NULL value
if you go to your visual editor and click the field and change the view as to a date time, i also go to the edit as and do the same thing. That blanks it out.
Also if you look at the release to prod if it is null it will return my value as null for days in Build status. I would like to if possible be able to have it use todays value to calculate instead of it being null
here is the demo account

http://demo.asprunner.net/tswan_billingsclinic_org/Project1/Build_Status_Report_report.php



Hi,
Please see my comments below:

  • i am wondering if i can add if null for released to prod to equal now Here is a sample for Mysql:

`Radiology Approval`,

if (`Released to Prod` is NULL,now(),`Released to Prod`)as `Released to Prod`,

DATEDIFF(`Released to Prod`, `Date Build Requested`) AS `Days in Build Status`


  • I cant get your statement to work. Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.
  • you said to add to sql staement would i actual add that to custom php? I'm not sure that I fully understand you. Could you re-phrase it?

J
Jane 5/21/2010

Hi,
it is not a support forum. If you need a reply from support open a ticket at http://support.xlinesoft.com sending link to your project on the Demo Account and detailed description of what doesn't work properly.