#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Question Stored Procedure


    Here is what I am trying to do:

    I have a MSSQL table that is being written to every 5 minutes with data, so this amounts to 288 points of data every 24 hours. I need to be able to have a stored procedure that will give me the MAX value found within that most recent 24 hour period. The 24 hour period needs to have a fixed pointer that starts at 12 AM on the present day. So basically I would like to be able to run the stored procedure periodically at will, which would then return the MAX value of the accumulated data from the current 24 hour period.

    Your expertise would be appreciated thank you in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Sep 2011
    Posts
    105
    Rep Power
    4
    Hello,

    Write a query.

    use the date column in your table if you have one

    select max(id) from table where your datecolumn >= 00:00 and
    datecolumn <= 12:00 PM
  4. #3
  5. 0x800A0C93
    ASP Super Hero (2500 - 2999 posts)

    Join Date
    Jan 2009
    Location
    Ridin' through this world...
    Posts
    2,975
    Rep Power
    1310
    The first step in making a query into a stored procedure is to have a functioning query. You haven't told us much about your data. Do you have a functional query that delivers what you want? How are you intending to call your stored procedure? An ASP Web page?
    Brinkster- free development account. Not affiliated, but I sure like free. Brinkster.com
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0
    Appreciate the replys ,

    I have been working on the querys without much success ..
  8. #5
  9. 0x800A0C93
    ASP Super Hero (2500 - 2999 posts)

    Join Date
    Jan 2009
    Location
    Ridin' through this world...
    Posts
    2,975
    Rep Power
    1310
    This is like a school assignment. You have to show your work.

    Show us what you have and tell us about the data.
  10. #6
  11. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0
    Getting things done through this has always been great for every one and for us as well........


    ____________________________
    www dealaboo dot Com

Similar Threads

  1. Stored Procedure Problems (2)
    By PhilCollins99 in forum Microsoft SQL Server
    Replies: 11
    Last Post: July 5th, 2005, 03:59 PM
  2. Exception Handling
    By kirandayalin in forum ASP Development
    Replies: 14
    Last Post: April 21st, 2005, 01:16 PM
  3. Using Default parameter values for T-SQL stored procedures
    By sivakumar.k in forum Development Articles
    Replies: 0
    Last Post: November 9th, 2004, 04:12 AM
  4. Error on Running Stored Procedure on SQL
    By mayde78 in forum ASP Development
    Replies: 0
    Last Post: July 26th, 2004, 03:04 PM
  5. Calling SQL Stored procedure within MS Access 97
    By jpiscit1 in forum Microsoft Access Help
    Replies: 1
    Last Post: March 10th, 2004, 10:21 AM

IMN logo majestic logo threadwatch logo seochat tools logo