generate, reset an order number daily

Discussion in 'ASP General' started by Doug Parker, Apr 15, 2004.

  1. Doug Parker

    Doug Parker Guest

    I have a client that needs me to generate and order number for each order
    processed. They want the number to be something like "X24106W1" with the
    "1" at the end being the number of the order processed in the day. So in
    "X24106W1" the "1" means that it's the first order of the day. ""X24106W2"
    would be the second order, "X24106W3" the third, so on. I need to find a
    way to store that number, then call and it so that I can append it to the
    order number every time someone places an order, and then augment it
    appropriately. I was thinking of doing this in a text file, but I don't
    know how to reset the file back to 0 with each new day.

    Any help would be greatly appreciated.

    --



    ------------------------------------------------------------
    http://www.phreshdesign.com
    Doug Parker, Apr 15, 2004
    #1
    1. Advertising

  2. Doug Parker

    Mark Schupp Guest

    Keep the last reset date in the file with the counter.
    Each time you access the counter, check the date. If the date is before the
    current date then reset the counter and add the current date.

    You can use the filesystem object to read and update the file.

    You will also need to use application.lock and unlock to serialize access to
    the file.

    For more info on using the FSO see http://www.aspfaq.com/show.asp?id=2039

    You can also do the same thing with a database.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Doug Parker" <> wrote in message
    news:...
    > I have a client that needs me to generate and order number for each order
    > processed. They want the number to be something like "X24106W1" with the
    > "1" at the end being the number of the order processed in the day. So in
    > "X24106W1" the "1" means that it's the first order of the day.

    ""X24106W2"
    > would be the second order, "X24106W3" the third, so on. I need to find a
    > way to store that number, then call and it so that I can append it to the
    > order number every time someone places an order, and then augment it
    > appropriately. I was thinking of doing this in a text file, but I don't
    > know how to reset the file back to 0 with each new day.
    >
    > Any help would be greatly appreciated.
    >
    > --
    >
    >
    >
    > ------------------------------------------------------------
    > http://www.phreshdesign.com
    >
    >
    Mark Schupp, Apr 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. matt
    Replies:
    1
    Views:
    9,655
    =?Utf-8?B?cm9iX2Jvc3Rvbg==?=
    Apr 6, 2004
  2. i. Wiin

    Daily Graphs of activity

    i. Wiin, Sep 30, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    713
    Lucas Tam
    Oct 6, 2004
  3. ree32

    Running a Daily Routine/Process

    ree32, Apr 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    421
    Curt_C [MVP]
    Apr 29, 2005
  4. Steve Richter

    Running daily process on hosted web site

    Steve Richter, May 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    511
    Steve Richter
    May 6, 2005
  5. Replies:
    2
    Views:
    403
    Eliyahu Goldin
    Aug 16, 2005
Loading...

Share This Page