K
Kim
I've got this query that works just fine in access.
In it's query it makes use of some linked tables that it groups and sums,
taking the query into sql-server doesn't work and I need some help
understanding it
As I understood from reading access uses (can use) functions such as sum and
joins to return whole tables (resultsets from tables that it then goups ?),
I don't get it and I don't understand how to translate a query like the one
below to get it to work on sql-server.
If you can help me out with this I'd appreciate it
If you can't examplify the weid join for me using these tables, please use
others and help me out...
How can you do like this in sql-server ((PROJ INNER JOIN (TS INNER JOIN TASK
ON TS.task_id = TASK.task_id) ON PROJ.ws_id = TASK.ws_id) ?
SELECT PROJ.ws_id,
X_RS.RS_TT__rs_ca_sh_name,
X_RS.RS_AR__rs_ca_sh_name,
X_RS.RS_KT__rs_ca_sh_name,
T_SPR.start_date, Sum(T_SPR.act_qty) AS Sum_qty,
Sum(T_SPR.remain_qty) AS Sumremain_qty,
Sum(T_SPR.act_cost) AS Sumact_cost,
Sum(T_SPR.remain_cost) AS Sumremain_cost
FROM
((PROJ INNER JOIN (TS INNER JOIN TASK ON TS.task_id = TASK.task_id) ON
PROJ.ws_id = TASK.ws_id) INNER JOIN T_SPR ON TS.taskrsrc_id =
T_SPR.taskrsrc_id) INNER JOIN X_RS ON TS.rsrc_id = X_RS.rsrc_id GROUP BY
PROJ.ws_id, X_RS.RS_TT__rs_ca_sh_name, X_RS.RS_AR__rs_ca_sh_name,
X_RS.RS_KT__rs_ca_sh_name, T_SPR.start_date;
In it's query it makes use of some linked tables that it groups and sums,
taking the query into sql-server doesn't work and I need some help
understanding it
As I understood from reading access uses (can use) functions such as sum and
joins to return whole tables (resultsets from tables that it then goups ?),
I don't get it and I don't understand how to translate a query like the one
below to get it to work on sql-server.
If you can help me out with this I'd appreciate it
If you can't examplify the weid join for me using these tables, please use
others and help me out...
How can you do like this in sql-server ((PROJ INNER JOIN (TS INNER JOIN TASK
ON TS.task_id = TASK.task_id) ON PROJ.ws_id = TASK.ws_id) ?
SELECT PROJ.ws_id,
X_RS.RS_TT__rs_ca_sh_name,
X_RS.RS_AR__rs_ca_sh_name,
X_RS.RS_KT__rs_ca_sh_name,
T_SPR.start_date, Sum(T_SPR.act_qty) AS Sum_qty,
Sum(T_SPR.remain_qty) AS Sumremain_qty,
Sum(T_SPR.act_cost) AS Sumact_cost,
Sum(T_SPR.remain_cost) AS Sumremain_cost
FROM
((PROJ INNER JOIN (TS INNER JOIN TASK ON TS.task_id = TASK.task_id) ON
PROJ.ws_id = TASK.ws_id) INNER JOIN T_SPR ON TS.taskrsrc_id =
T_SPR.taskrsrc_id) INNER JOIN X_RS ON TS.rsrc_id = X_RS.rsrc_id GROUP BY
PROJ.ws_id, X_RS.RS_TT__rs_ca_sh_name, X_RS.RS_AR__rs_ca_sh_name,
X_RS.RS_KT__rs_ca_sh_name, T_SPR.start_date;