p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   Automatic datetime (http://p2p.wrox.com/showthread.php?t=65837)

phuc2583 February 11th, 2008 09:05 PM

Automatic datetime
I have some problem about the date time.I want to save a database with write by access that ID such as:yymm####
yy;year get two numbers(2008)->08
mm:month get two numbers->02
####:the order:0001,0002
the whole function:08020001
when i save a customer that,Id increase 08020002,...,08020010...
but step another month that increase 08030001,08030002,...,08030010..
and go on like that
and also the year increase(2009) :09010001,..09010010
Please help me to do that
thanks so much
Hoang Phuc

phuc2583 February 12th, 2008 10:21 PM

please help to do that.I need that code or your know another page that give the same code.

mat41 February 13th, 2008 07:23 PM

Have you treid to write the code? If so post it and explain where you issue is, if not you need to at least give it a go.

To get the best out of forums - Come here and take peoples time for problems within solution, not to have complete solutions written for you

Wind is your friend

phuc2583 February 17th, 2008 10:23 PM

please check the code that wrote
i try do it but not run
if trim(request("Option"))="AddOrder" then
        Set rs = Server.CreateObject("ADODB.Recordset")
       ' rs.Open "orderdetail", conn, 1, 2
          rs.CursorType = 1

          rs.LockType = 3

          rs.Open "orderdetail", Conn

        ' Adding data
         if not rs.eof then
                    strmonth=Right("0" & DatePart("m", Now()), 2)
                    stryear=Right(DatePart("yyyy", Now()), 2)
                    NewsOrderID=stryear & strmonth & strday & Right("0000" & NewOrderNumber, 4)
                    if not rs.eof then


                    end if

                   rs("OrderID")= NewsorderID
                rs("CustomerId") = CustomerId
                rs("Item") = Items
                rs("Description") = Descriptions
                rs("price") = price
                rs("UnitCurrency") = UnitCurrency
                rs("CreateDate") = CreateDate
                rs("ExpirationDate") = ExpirationDate
                    end if

        response.Redirect "ShowOrderdetail.asp"
            Set rs = Nothing
    end if

All times are GMT -4. The time now is 08:50 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.