November 10, 2010 at 8:17 am
SELECT "TASKS"."HOURS", "TASKS"."WO_NUM", "TASKS"."DEPT_NUM", "TASKS"."REQUEST", "TASKS"."CLSDDATE", "STAF"."LOGIN", "TIUSER"."NTACCOUNT", "TASKS"."TASK"
FROM ("TRACKIT_DATA"."dbo"."TASKS" "TASKS" INNER JOIN "TRACKIT_DATA"."dbo"."STAF" "STAF" ON "TASKS"."RESPONS"="STAF"."NAME") INNER JOIN
"TRACKIT_DATA"."dbo"."TIUSER" "TIUSER" ON "TASKS"."REQUEST"="TIUSER"."FULLNAME" WHERE "TASKS"."HOURS">0 AND ("TASKS"."CLSDDATE">={ts '2010-10-20 00:00:00'} AND
"TASKS"."CLSDDATE"<{ts '2010-11-06 00:00:00'})
Thanks..:-P
November 10, 2010 at 8:26 am
Hi David,
Sure, the tables used are:
Database: TRACKIT_DATA
Schema: dbo (that's the default)
Tables: TASKS, STAF and TIUSER
November 10, 2010 at 8:29 am
Thanks a ton..
November 10, 2010 at 8:47 am
As a hint, the structure is:
from
inner join
on [condition] inner join
on [condition]
The table naming is:
server.database.schema.table
Server, database, schema are optional, but are used to differentiate from other objects or because needed in a few situations, like Linked Servers or a separate location.
November 10, 2010 at 8:49 am
Again steve thanks a ton..
November 10, 2010 at 9:12 am
Sometimes, as was the case with your query, people put an alias after the server.database.schema.table construct. That's why you see "TASKS", "STAF" and "TIUSER" there twice in succession. Yours isn;t a great example but aliases can save typing later on. It's a way of having one (normally short) word refer to the whole thing.
November 10, 2010 at 9:15 am
Thanks SIR..
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply