Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one to many search

Status
Not open for further replies.

shaminda

Programmer
Jun 9, 2000
170
US
I have an application in VB and a table in Access, I want know the best result to solve the problem.<br><br>there are two tables say table1 and table2<br>table1 has fields ID, SSN, HireDate. Table2 has ID, SSN, AbsDate.<br>for 1 SSN in table1 has many SSN in table2<br><br>what is the SQL statement to calculate the time period between AbsDate and HireDate.<br><br><br>
 
Try<br>SELECT t1.SSN, t2.abs_date - t1.hiredate<br>FROM table1 t1, table2 t2<br>WHERE t1.SSN = t2.SSN;<br><br>I<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top