I am trying to execute a SQL query from sharepoint to MSSQL2008 and I'm not getting very far. I have a SQL query that works in excel but I want to be able to convert that to a web part.
I can connect to the database fine and I can get the following to run ok
I am looking to get the following excel SQL query to run.SELECT * FROM dbo . [Activity_List]
Any help would be greatly appreciated.SELECT
WO_Op_List."Op No",
WO_Op_List."WC Name",
WO_Op_List."Last Start Date",
Activity_List."Complete",
Activity_List."Activity Type",
Activity_List."For Employee",
Activity_List."Notes",
Work_Orders_List."WO No",
Work_Orders_List."Description",
Work_Orders_List."SO Customer",
Work_Orders_List."Drawing No",
Activity."Next_Date"
FROM
(((WORK_ORDERS WORK_ORDERS INNER JOIN WO_Op_List WO_Op_List ON
WORK_ORDERS."WORK_ORDERS_ID" = WO_Op_List."WORK_ORDERS_ID")
INNER JOIN Activity_List Activity_List ON
WORK_ORDERS."WORK_ORDERS_ID" = Activity_List."WORK_ORDERS__WORK_ORDERS_ID")
INNER JOIN Work_Orders_List Work_Orders_List ON
WORK_ORDERS."WORK_ORDERS_ID" = Work_Orders_List."WORK_ORDERS_ID")
INNER JOIN Activity Activity ON
Activity_List."Activity_ID" = Activity."Activity_ID"
WHERE
Activity_List."Complete" = 0 AND
WO_Op_List."Op No" = '30' AND
(Activity_List."For Employee" = 'Hugh Jarse' OR
Activity_List."For Employee" = 'Ivor Biggun' OR
Activity_List."For Employee" = 'Willie Annall' OR
Activity_List."For Employee" = 'Team')