IBM Support

The Format Display of Date or Date and Time appear in "0" or "null"

Question & Answer


Question

How can I change the Format Display of a Date/Data and Time Field?

Cause


When retrieving data using the Database Query Tool. Values show in "zero" and some are in "null"





See below Sample Steps for reproducing in an Out of the Box Application

PHASE 1
S01) Log in IBM TRIRIGA Application;
S02) Go to Home -> Projects -> Facilities;
S03) Under Facilities Projects section, click on the "New Project" button;
S04) Enter with the mandatory fields on the General and Contacts tabs;
S05) Go to the Schedule tab, enter with the one work task (for the work task, enter only with the mandatory fields);
S06) Click on the Create Draft and then Save & Close buttons;
S07) Log in to IBM TRIRIGA Admin Console -> Database Query Tool and execute the following SQL statement:

"select trireportingnametx, triactualstartdt, tricontstraintdt, triactualenddt from t_trischeduletask"

(From this query you should see some enties where either some or all of triactualstartdt, triconstraintdt or triactualenddt are set to ‘0’. This should not be the case.)


PHASE 2: To create and facility project with a bad (0) work task entry

1)Login into TRIRIGA
2)Select projects them the setup drop down
3)From the dropdown select ‘Facilities Project’ under Project templates
4)Under project templates select any template and open it
5) select the ‘Schedule’ tab
6) Select ‘add’ under project tasks and then ‘Scheduled Task Template’
7) Fill out ‘Name’ , and ‘Planned working days’ , write down what you named the task you will look for this when you run the query in step S07.
8) Hit ‘Create template’
9)Hit ‘Save & Close’ on the scheduled task
10) hit ‘Save and Close’ again on the project template
11) Create a new facility project
12) Create the draft project with all required fields (values don’t really matter, just do the required fields) and click ‘Create Draft’
13) after you create the draft click ‘More’ and select “Apply Template’
14) Select the template you updated in step 7 and hit ‘Continue’
15) hit ‘Save and Close’
16) Run the query found in S07 and look for the TRIREPORTINGNAMETX that you created in step 7
You should see ‘0’s vs the correct ‘NULL’

Answer

There is a TRIRIGA Property that can control the format display for fields such as Date or Date and Time.

# This property is used at record runtime to determine whether number fields render 0 for null value or show empty field.
# When the value is Y, a number field renders zero in a form when the value in the database is null.
# When the value is N, a number field renders empty in a form when the value in the database is null.
# The default value of this property is Y.
SHOW_ZEROS_IN_NUMBER_FIELDS=Y

It will allow you to show "0" or "null". The platform data can store as null or 0 in the back end database. When the query is run in TRIRIGA, the platform will format it accordingly.

[{"Product":{"code":"SSHEB3","label":"IBM TRIRIGA Application Platform"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"IBM TRIRIGA Application Platform","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"3.4.2;Version Independent","Edition":"Edition Independent","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg21984712