By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

store procedure

100+
P: 145
I am brand new in SP. I have a access query that cannot recreate in SQL view cause it requires parameter so I am trying to create SP for following select statement. Later I will use this SP so other things.

Any help or links would be greatly appreciated.

SELECT pTask.customer_id, pTask.PRJ_id, pTask.id AS PRJ_task_id, pTask.default_category AS category_id, 1 AS user_id, [pTDate] AS [date], "T" AS Type, Sum([total]*[custom_6]/100) AS rate, 1 AS [decimal], Sum([total]*[custom_6]/100) AS AdderFee, 0 AS Charge_stage_id, "Tolls, Reproduction & Technology" AS description, "@ " & [custom_6] & "% of task hourly Total" AS [note], 1 AS adder_charge
FROM (Charge INNER JOIN pTask ON Charge.PRJ_task_id = pTask.id) INNER JOIN PRJ ON pTask.PRJ_id = PRJ.id
WHERE (((PRJ.custom_6)>0) AND ((pTask.custom_14)="1") AND ((Charge.Charge_stage_id)=0) AND ((Charge.invoice_id)=0) AND ((Charge.deleted) Is Null) AND ((Charge.Charge_type_id)=1) AND ((Charge.custom_16) Is Null) AND ((Charge.custom_17) Is Null))
GROUP BY pTask.customer_id, pTask.PRJ_id, pTask.id, pTask.default_category, 1, [pTDate], "T", 1, 0, "my custom desc.", "@ " & [custom_6] & "% of task hourly Total", 1;
May 28 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
You can create a connection. Build your query dynamically, including these parameters, and execute it.

-- CK
May 29 '08 #2

P: 92
Try to look at this link ...
May 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.