Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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..!!

Reply With Quote
  #2 (permalink)  
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
Default

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.

http://www.dotnetohio.com
Reply With Quote
  #3 (permalink)  
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
Default

> 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
    12/31/2007
as
    December 31, 2007
And it will *ALWAYS* see
    31/12/2007
as
    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:
http://msdn.microsoft.com/en-us/library/0h88fahh(VS.80).aspx
(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:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=189

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.
Reply With Quote
  #4 (permalink)  
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?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 02:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.