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 September 30th, 2003, 07:14 AM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default MS Access and ASP : DATE Format failure

Hi,

Can someone please tell me whether it is possible to copy the format of a field instead of the basic data ?

e.g. I use a DATE/TIME Data Type in MS Access with a Long Date format but when I use objRS("Date") on an ASP page, I simply get 30/09/2003 instead of "Monday, September 30, 2003".

Is there a way we can set an option in ASP, ADO or MS Access to get the data right ? Thanks for yor advice.

Sebastiaan.
 
Old October 1st, 2003, 05:53 AM
Authorized User
 
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sankar
Default

Quote:
quote:Originally posted by Sebastiaan
 Hi,

Can someone please tell me whether it is possible to copy the format of a field instead of the basic data ?

e.g. I use a DATE/TIME Data Type in MS Access with a Long Date format but when I use objRS("Date") on an ASP page, I simply get 30/09/2003 instead of "Monday, September 30, 2003".

Is there a way we can set an option in ASP, ADO or MS Access to get the data right ? Thanks for yor advice.

Sebastiaan.
Hi Sebastiaan,
Use FormatDateTime(objRs("Date"),1) instead of simply objRs("Date") to get the desired output. FormatDateTime is a VB Script function.
HTH
Cheers!

Sankar Sengupta
 
Old October 1st, 2003, 12:32 PM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sankar, thanks for your help, this function works fine, very easy to use

Seb.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the format of MS Excel Cells from MS Access hewstone999 Access VBA 0 March 7th, 2008 07:19 AM
ASP/Access Date Format seananderson Classic ASP Databases 2 November 6th, 2006 02:15 PM
Syntax of date function in MS Access krishreddy Access 3 July 25th, 2006 03:42 PM
Access 97 Date format problem Andrew Antoniak Access VBA 2 February 21st, 2004 12:47 PM





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