Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP 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 June 8th, 2007, 10:41 AM
Registered User
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default date display problem

In database i am getting date format as desired i.e.12/5/2007 means 12th may but while retrieving it using ASP(vbscript) it displays as 5/12/2007.Please somebody help..!!

Old July 16th, 2008, 10:10 PM
Registered User
Join Date: Jul 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dotnetter_ohio

First thing... Try using a different date, i.e. 12/31 and see what happens. You might have something in the database showing the date in a European / Western format.

When you figure out what is going on, you can format the date in Access to be appropriate or on your page using date/time properties. I don't know these off the top of my head, but you can just google them. There are a million and one sites on setting datatypes.

Hope this helps.

Old July 17th, 2008, 12:55 AM
Friend of Wrox
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

> Try using a different date, i.e. 12/31 and see what happens

Actually, that probably won't help.

Access is too smart for your own good. When it sees a month number that is too large to *BE* a month, it just automatically assumes that you inverted the month and day.

So it will *ALWAYS* see
    December 31, 2007
And it will *ALWAYS* see
    31 December 2007

A better check, to find out what is *REALLY* STORED in the DB is to use something like
    SELECT Day(datefield), MonthName(Month(datefield)), Year(datefield)
getting the three parts of the date separately.


On top of all of the above: When you use SQL to query an Access DB, you must *ALWAYS* use #MM/DD/YYYY#. SQL queries to Access simply do *NOT* understand the DD/MM/YYYY format. [But, again, if you give it #31/12/2007# *then* it will see the 31 as a day and act correctly.]

The safest way to be 100% sure that the dates you are giving Access via SQL are correct is to use ISO format: #YYYY/MM/DD#. When you use a 4-digit year as the first part of the date, Access *has* to assume you mean yyyy/mm/dd.

And finally, even if the date stored in the DB *is* "12 May 2007", how that gets displayed in ASP/VBScript depends upon the *LOCALE* where the IIS web server is running!!! If the web server is running in USA locale, then you *WILL* see the USA format of mm/dd/yyyy from VBScript.

Luckily, this is something you can easily change. Just do
    Session.LCID = XXXX
at the top of your page, where XXXX is the appropriate value for your country and location. You can see a list of LCID values here:
(You'll have to copy/paste that to your browser address bar; this forum can't handle some characters in URLs.)


Last but not least... To understand a bit more about all this seeming arcane stuff, look here:

I wrote that 6 years ago, but it's amazing how many people still don't understand it, today. It even comes back to bite ASP.NET users.
Old October 22nd, 2012, 03:56 AM
Registered User
Points: 27, Level: 1
Points: 27, Level: 1 Points: 27, Level: 1 Points: 27, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Sep 2012
Location: 1453 Gingerwood ave, Milpitas CA 95035, USA
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default re

well i also dont get icon of Indian currency..any help?

Similar Threads
Thread Thread Starter Forum Replies Last Post
display last user and modified date punky08 Classic ASP Basics 1 June 24th, 2008 02:52 PM
Dynamic Date Display velcrobomb SQL Language 3 April 3rd, 2007 10:10 AM
Display Table by Date werD420 Classic ASP Databases 9 January 31st, 2005 05:26 PM
Date didn't display in pdf chinhow Crystal Reports 4 April 13th, 2004 03:29 AM
date mysql to php display Geeman PHP Databases 4 September 1st, 2003 08:13 AM

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