Results 1 to 2 of 2
  1. #1
    talhaparvaiz@yahoo.com is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2020
    Posts
    29

    Execute stored procedure and save values in a table

    Hello, I have around 1000 values that I'd like to execute against my SQL code and store the resulting data in a table for further analysis.
    Here is an example of my SQL code:


    INSERT INTO Summary_Final ( PD_Deadline, stock, sell, [count] )
    SELECT x.PD_Deadline, x.stock, x.sell, x.[count]
    FROM (




    SELECT
    -0.15 as PD_Deadline,
    a.stock, a.sell, Count(*) AS [count]
    FROM (
    SELECT Data.Stock, Data.Date, Data.Buy_price*(1+(0.05)) AS Sell
    FROM Data ) AS a
    WHERE a.[Flag]="Y"
    GROUP BY a.stock, a.sell


    ) as x;




    The values represented by -0.15 and 0.05 in the code serve as adjustable parameters. If I were to manually execute the code, I'd modify these parameters individually for approximately 1000 instances and run the code for each specific set of values.It would be more efficient to store these parameters in a table, transform the existing code into a function, and then invoke the function within a loop.
    As a new bee, I would appreciate detailed guidance on this matter. Thank you in advance.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    crossposted here with answers

    https://www.access-programmers.co.uk...-table.330036/

    please read this link about the the risks of cross posting https://excelguru.ca/a-message-to-forum-cross-posters/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 11-12-2021, 03:37 PM
  2. Replies: 33
    Last Post: 09-25-2015, 08:39 AM
  3. Access 2010 Trying to execute a stored proedure via ADO
    By system243trd in forum Programming
    Replies: 1
    Last Post: 01-29-2013, 09:05 AM
  4. Execute MySQL Stored Procedure with Access 2010 VBA?
    By DanielHofer in forum Programming
    Replies: 5
    Last Post: 01-23-2012, 01:08 PM
  5. Passing variable values to Stored Procedure
    By rodrigopcnet in forum Access
    Replies: 1
    Last Post: 04-14-2010, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums