relationship field type

This forum is for application developers who are integrating HanDBase into their solutions via the HanDBase API (HAPI) or other means. It's also a great place to discuss runtime development.

relationship field type

Postby Steve » Fri Aug 08, 2014 10:45 am

EDIT: 8/14/14 - Corrected mistakes I just noticed in the DB definitions below.

I'm attempting to produce an aging list view of jobs.

Two tables:

Jobs(Relationship), CustomerList.CompanyName AND Job.CompanyName, Show last Job.Location
Today(date), use current date
LastJob(Relationship), CustomerList.CompanyName AND Job.Customer, Shows last Job.Opened.
ActiveStatus(calculated), Today - LastJob # LastJob = 12/23/13 and today = 08/08/2014 displays: 40385 rather than no of days

Customer(DB Popup), CustomerList.CompanyName

To test what I thought was happening i created a single DB:
Elapsed(Calculated), LastDate - FirstDate
Using the same dates as above ActiveStatus, Elapsed displays: 228.00
On the assumption that Relationship is returning a text value I changed FirstDate to type Text, which caused Elapsed to display 40385.

SO it looks like the display info returned by the relationship field is in text form rather than date, (in this case).
Is this a bug?

If not, would it be possible to add conversion functions to the Calcuated field's function list??
OR cause the Relationship field to return the data type of the selected show field???

OR I'm missing something entirely,... which wouldn't be the first time. :D
Posts: 13
Joined: Thu Jun 25, 2009 6:39 pm

Re: relationship field type

Postby Brian_Houghton » Sun Aug 17, 2014 10:13 pm

Hi Steve,

Sorry for missing your initial question.

The relationship field pulls date values across as text, so to get the actual date in a number format that is usable you would have to add a field to the related table. The field would be a calculation and it would have the formula Date + 0 and the output as an integer.

You can hide this field if you want.

Then configure the relationship field to pull the integer field and use it in your calculation. You can do this for other date fields needed as well.

Hope this helps.
Kind Regards,
Brian Houghton, DDH Software
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Return to HanDBase - Developers

Who is online

Users browsing this forum: No registered users and 1 guest