Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 11th, 2008, 09:05 PM
Authorized User
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default 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

Old February 12th, 2008, 10:21 PM
Authorized User
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts

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

Old February 13th, 2008, 07:23 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

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
Old February 17th, 2008, 10:23 PM
Authorized User
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Update odezzie Classic ASP Databases 1 March 28th, 2007 06:06 PM
Automatic Download mailme.ami J2EE 1 November 24th, 2006 08:14 AM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
Automatic Redirect r_ganesh76 General .NET 3 September 9th, 2004 07:03 AM
Automatic URLs Imar Forum and Wrox.com Feedback 13 June 19th, 2003 03:01 AM

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