I am working on a database system with Drupal 7. I have node types employee, experience etc. With relationship (reference entity), each employ may have zero or more records in experience. Experience node type has a date field (with start and end date) and what I want is to
- Calculate a duration or each experience record from stat and end date.
- Calculate total experience (sum of durations)
- Display total experience (that is sum of the durations) in view of employee with other fields of employee
Example;
Employee VIEW
E_code, Ename, total experience
1 xyz 2 years and 3 months
2 nmn 6 months
3 abc 1 year 7 months
Employees records
Ecode, Ename, Ephone, etc.
1 xyz 5458254 etc
2 nmn 59457495 etc
3 abc 45749 etc
. . . . .and so on
Experience records
E_code, exp_date
1 01/01/2010 to 01/03/2011
2 01/01/2011 to 30/06/2011
1 01/06/2012 to 30/09/2013
. . . . and so on
How to bring total experience of each employee in the Employee table View?
Another question how we refer node field i.e. exp date for global math expression or computed field? In other view i have date field and need subtract that from current date (now?) I thought the global math expression can do that by joint_Date - Now. But not sure. Note I don't need to save this duration in field it should appears in view on go.
Thanks in advance.