...

View Full Version : Code to generate date/time of purchase



yida88
01-11-2007, 03:41 PM
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.


<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>

Spudhead
01-11-2007, 04:17 PM
I'm not entirely sure what you want to do, but you can get the date/time in ASP using Now()


<%=now()%>

Is that any use?

jammy
01-11-2007, 10:49 PM
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...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum