generate, reset an order number daily

D

Doug Parker

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.

--
 
M

Mark Schupp

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top