Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 November 6th, 2006, 10:40 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP/Access Date Format

My ASP pages saves a date string (in Access) as:

UPDATE TABLE SET REPORTDATE = #dd/mm/yyyy#;
UPDATE TABLE SET REPORTDATE = #06/11/2006#;

If I open the table in Access the column (MediumDate) will show as:

06-NOV-2006

When I reopen the record with ASP

Response.Write rs("REPORTDATE")

... I get 11/06/2006

I have changed the design for the column to show as a ShortDate which produces 11/06/2006, but still have an ASP page producing a date from June.

Any help to providing a decent fix for this, would be appreciated.

Regards,

Sean Anderson
__________________
Regards,

Sean Anderson
 
Old November 6th, 2006, 12:52 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It has been a long time since I used Access but you may want to try this select statement. (This may or may not work, but I know it to work in MSSQL)

SELECT
    Convert(varchar(10), REPORTDATE, 101) as [REPORTDATE]
FROM
   [YourTableNameHere]


-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old November 6th, 2006, 02:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There's a fair chance your data has been changed due to the regional settings on your server. So, 6/11 is interpreted as June 11th instead of November 6th.

One way to insert data to circumvent this problem, regardless of the regional settings, is with the ISO format:

#yyyy/mm/dd#

This date is always interpreted in the correct format.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Date Format apollon10 ASP.NET 3.5 Professionals 1 November 13th, 2007 05:54 AM
date format in ASP ? mateenmohd SQL Server 2000 8 February 22nd, 2004 01:17 AM
Access 97 Date format problem Andrew Antoniak Access VBA 2 February 21st, 2004 12:47 PM
MS Access and ASP : DATE Format failure Sebastiaan Classic ASP Basics 2 October 1st, 2003 12:32 PM





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