473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

store procedure

145 100+
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
2 1046
ck9663
2,878 Expert 2GB
You can create a connection. Build your query dynamically, including these parameters, and execute it.

-- CK
May 29 '08 #2
deric
92
Try to look at this link ...
May 29 '08 #3

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

Similar topics

2
by: Jin | last post by:
Hello: I run one process that calls the following the store procedure and works fine. create PROCEDURE sp_GetHostSequenceNum AS BEGIN SELECT int_parameter_dbf + 1
1
by: Hugo Lefevre | last post by:
Dear, I have a problem : I have a database which contains my data of hardware. The Id is a varchar and I want at my filling form that my user know which is the last one. So I made a store...
3
by: serge calderara | last post by:
Dear all, One simple question relative to store procedure withinh ASP code on a web page. Let say that I am calling a store procedure to execute from a server button click on my web page. That...
1
by: TARUN | last post by:
Hello All I get stuck in one problem , Please help me and excuse me on the poor Knowledge in SQL Server Store procedure Q1...I want to return a string type value from store procedure , Is it...
8
by: gacuna | last post by:
i want to insert into a temporal table the result of a store procedure. on sql server the sentence would look like this (already working) INSERT INTO #SHIPINFO exec TESTDTA.S59RSH05 @SCBILLTO,...
6
by: c676228 | last post by:
Hi everyone, I wrote a store procedure that fetch one row data in the database based on the parameter value I entered. After I created the store procedure, the store procedure code looks like...
0
by: rxding | last post by:
Hello, Performance reason we need to move some of our code into database. Java Store Procedure is given the first choice. However, while investigating some sample code of Java store procedure, ...
0
by: zhenyuandeng | last post by:
Hi, When i call the procedure sp_jysczld_new from the Query Analyzer, it runs slowly. But when i extract the sql scripts from the procedure sp_jysczld_new, it runs quickly. Why? I don't...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
2
by: kuchel | last post by:
Hi I am trying to run 4 - 5 store procedure in a strict order. I have created a SSIS package whereby I trying to execute store procedure in a orderly fashion. I have created constraints between...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.