Results 1 to 3 of 3

Thread: Stored procedure with date

  1. #1
    Su Ge Guest

    Stored procedure with date

    There is a stored procedure to run each Sunday. I would like to get the order date from previous Sunday through Saturday. Right now we code as
    "OrderDate Between convert(datetime, '05/02/99&#39 AND
    convert(datetime, '05/08/99&#39 "
    Each week the dates have to be manually changed. How to use the date function to make it automated?

  2. #2
    Gregory Guest

    Stored procedure with date (reply)

    if you run it every sunday:

    OrderDate between DateAdd(wk,-1, GetDate()) and DateAdd(dd,-1,GetDate())


    ------------
    Su Ge at 5/7/99 8:26:57 AM

    There is a stored procedure to run each Sunday. I would like to get the order date from previous Sunday through Saturday. Right now we code as
    "OrderDate Between convert(datetime, '05/02/99&#39 AND
    convert(datetime, '05/08/99&#39 "
    Each week the dates have to be manually changed. How to use the date function to make it automated?

  3. #3
    Su Ge Guest

    Stored procedure with date (reply)

    Thank you very much Gregory.


    ------------
    Gregory at 5/7/99 11:38:26 AM

    if you run it every sunday:

    OrderDate between DateAdd(wk,-1, GetDate()) and DateAdd(dd,-1,GetDate())


    ------------
    Su Ge at 5/7/99 8:26:57 AM

    There is a stored procedure to run each Sunday. I would like to get the order date from previous Sunday through Saturday. Right now we code as
    "OrderDate Between convert(datetime, '05/02/99&#39 AND
    convert(datetime, '05/08/99&#39 "
    Each week the dates have to be manually changed. How to use the date function to make it automated?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •