store procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dorandoran
    New Member
    • Feb 2007
    • 145

    store procedure

    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_c ategory 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.invoic e_id)=0) AND ((Charge.delete d) 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_c ategory, 1, [pTDate], "T", 1, 0, "my custom desc.", "@ " & [custom_6] & "% of task hourly Total", 1;
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    You can create a connection. Build your query dynamically, including these parameters, and execute it.

    -- CK

    Comment

    • deric
      New Member
      • Dec 2007
      • 92

      #3
      Try to look at this link ...

      Comment

      Working...