I want to write a small report. To find the incosistent records.
There are two tables with some data as mentioned below.
NAME INUMBER FROM_DAT TO_DAT
abc A001 01.01.2008 31.12.9999
bcd A002 01.01.0001 31.12.9999
cde A003 0 0
def A004 15.05.2008 20.06.2008
NAME VALID_FROM VALID_TO PH_NO
abc 20.01.2007 20.05.2007 123
bcd 20.09.2008 20.10.2008 234
cde 20.09.2009 20.10. 2010 345
def 15.04.2008 14.05.2008 456
The organization has plenty of employees like above who are valid in the organisation
for the period shown in DETAILS_TAB. Organization provides them phones. But
the validity of phone should not be beyond the validity of employee.
SO i should now provide a report which does all this.
Provide two fields to give a range of INUMBERs for which i want to check the
For each employee in this range, check if the FROM_DAT and TO_DAT , if they are 01.01.0001 and 31.12.9999
or 0 and 0 just leave it as it is. THis employee is consistent.
Else using this INUMBER, get its name from PHONE_TAB, check if VALID_FROM is less than FROM_DAT this is inconsistent record,
Or if VALID_TO is greater than TO_DAT this is also inconsistent.
So put all these INUMBERs into a local table and display them on the screen.
Could anyone please help me writing this report.
Many thanks in advance