Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code to generate date/time of purchase

    Hi.

    I am creating a ecommerce website using my school as the testing server.

    I am having problems at the ending: I am unable to generate a date/time at the point of purchase. I currently use a ms excess database to store all the data.

    Currently, I am using a recordset to generate the table using drag and drop.

    Code:
        <td><font face="Gill Sans MT">Order No </font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("OrderNo").Value)%></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Order Date </font></td>
                      <td><font face="Gill Sans MT">{rsOrderDetails.OrderDate}<font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Product ID </font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("ProductId").Value)%></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Product Name </font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("ProductName").Value)%></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Quantity</font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("Quantity").Value)%></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Unit Price </font></td>
                      <td><font face="Gill Sans MT"><%= FormatCurrency((rsOrderDetails.Fields.Item("Price").Value), 2, -2, -2, -2) %></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Amount</font></td>
                      <td><font face="Gill Sans MT"><%= FormatCurrency((rsOrderDetails.Fields.Item("Amount").Value), 2, -2, -2, -2) %></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">GST</font></td>
                      <td><font face="Gill Sans MT"><%= FormatCurrency((rsOrderDetails.Fields.Item("GST").Value), 2, -2, -2, -2) %></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Total Amount </font></td>
                      <td><font face="Gill Sans MT"><%= FormatCurrency((rsOrderDetails.Fields.Item("TotAmt").Value), 2, -2, -2, -2) %></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Payment Method </font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("PaymentMode").Value)%></font></td>
                    </tr>
                    <tr>
                      <td><font face="Gill Sans MT">Delivery Method </font></td>
                      <td><font face="Gill Sans MT"><%=(rsOrderDetails.Fields.Item("DeliveryMode").Value)%></font></td>

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I'm not entirely sure what you want to do, but you can get the date/time in ASP using Now()

    Code:
    <%=now()%>
    Is that any use?

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A straight forward way would be to set the default value of your field holding the purchase date/time to be "Now()" directly in the access database.

    Each time you add a new record it will automatically stamp the date and time for you.

    Hope that works for you...


  •  

    Posting Permissions

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