Delphiwhat
Programmer
Folks please help!! its driving me mad
I have 2 tables to store 'complaint information'
Table A only stores the latest complaint entry
Table B stores the history of the complaints (ie there could be 100 records with the same complaint_id_key)
eg table A fields are
complaint_ID_key, date_logged, Complaint_text
eg table B fields are
complaint_ID_key, date_logged, Complaint_text
Part 1
--------
Basically what i want to do is lookup table A to grab any complaint_id_key
then look up table B for this complaint_id_key and order the records by date - then grab the date of the record that was first logged.
Part2
-------
Subtract the latest date in table A from the earliest date in table B to give me a value in days. This will tell me
how long the complaint has been on the system
Any ideas would be greatly appreciated - i'm stumped I've tried everything but cant find a way of storing a temporary variable in SQL
J