Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need answers urgently please

Author  Topic 

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-08 : 12:29:17
Hello Friends,
1) I have a table and column names are
Executiveid
companyname
positiontitle
start date
enddate
I want to see all executives who worked for more than 1000 days in one job. I am not sure but may be i need to use datediff function.

i have 3 tables and i have to use joins
table 1 executive
executiveid
firstname
lastname
companyid

table2 company
companyid
companyname
sales
currencycode

table3 currency
currencycode
description

how am i supposed to join 3 tables. i know how to give joins on 2 tables.

Your help will be greatly appreciated. Thanks

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-08 : 12:33:29
1.
where datediffd, startDate, enddate) > 1000

2.
3 joins are same as 2 joins:
select...
from table1 t1
join table2 t2 on t1.id = t2.id
join table3 t3 on t2.id = t3.id
where ...


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-08 : 12:42:25
Thank You Spirit1. Appreciate it.
Go to Top of Page
   

- Advertisement -