Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Date format in MS ACCESS

Posted on 2003-11-03
19
Medium Priority
?
9,725 Views
Last Modified: 2012-06-21
Hey folks,

I’m working on a dynamic website using asp and ms access . in the database I created I have a field in one of the tables with the data type date/time and the. I want the date in the format dd/mm/yyyy and I set the format in ms access just like this but it doesn’t seems to be working. It’s in the formt mm/dd/yy. can anybody tell me how I should go about it?
Thanks.
0
Comment
Question by:keroroza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 2
  • +2
19 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 9669653
Wouldn't you want the date presented in the User's local format?

You can use:

FormatDateTime(Date(),vbLongDate)   ' or shortdate

(also, I assume you mean you are accessing the 'Access' database via asp, not writing  asp from within Access)


Pete
0
 

Author Comment

by:keroroza
ID: 9669855
Yeah that's right i am accessing the Access database via asp. But the date format should be the dd/mm/yy
0
 

Author Comment

by:keroroza
ID: 9669857
Yeah that's right i am accessing the Access database via asp. But the date format should be the dd/mm/yy
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 77

Expert Comment

by:peter57r
ID: 9669918
Well there is general date format function here:
http://www.peterweighill.co.uk/asp.html

Pete
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 9670166
Any formatting you do in Access isn't going to be automatically reflected in your web page.
0
 

Author Comment

by:keroroza
ID: 9670196
But I’m reading the date from an access table
0
 
LVL 77

Expert Comment

by:peter57r
ID: 9670377
Access formatting is for Access users.

You are NOT using Access.  You are using the data tables part of an Access application.
The tables are managed by a completely separate program called JET.  That is why you use the JETOLEDB provider not an Access OLEDB provider.  

The 'Access' part of MS-Access is the bit that enables you to create a user interface and process the data in the tables.
You are using a different UI tool so all you have is what is contained in the JET table definition which is much less than Access allows you to specifiy.

You have to assume that you just have raw data values in the table.  Everything else is down to you with your front-end design.

Pete



0
 

Author Comment

by:keroroza
ID: 9670433
so you are telling me i should specify the format in my vbscript code, and if that's so is ther a function for that?
0
 

Author Comment

by:keroroza
ID: 9670434
so you are telling me i should specify the format in my vbscript code, and if that's so is there a function for that?
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 9670458
I think the functions you need have already been mentioned above.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 9670582
As i said before:
Well there is general date format function here:
http://www.peterweighill.co.uk/asp.html

Pete

0
 
LVL 2

Expert Comment

by:thorkyl
ID: 9671332
With asp accessing the database there are two ways to deal with it.

First and simplest is to go to the operating system and change the way it displays the date.
To do this:
   Control Pannel => Regional Settings => Date

NOTE: This will effect all settings on the server including file save dates on the shares.

Second is to change your ASP code.
Format(vMyDate,"dd/mm/yyyy")

Thorkyl
0
 
LVL 77

Expert Comment

by:peter57r
ID: 9671420
?Format()
In Vbscript?

Pete

0
 

Author Comment

by:keroroza
ID: 9676800
Vbscript doesn't know the function format()
0
 

Author Comment

by:keroroza
ID: 9676972
Is there a way to format the date read from the access table to an european date format that is dd/mm/yy i'm looking for a built in funtion like foratdatetime()
0
 
LVL 77

Expert Comment

by:peter57r
ID: 9677020
'i'm looking for a built in funtion'

There isn't one.

Pete
0
 
LVL 2

Expert Comment

by:thorkyl
ID: 9678673
if your looking for a built in function then you will need change the OS settings on the server.

Access does not control the way dates are displayed in any application except Access only the way they are stored.
0
 
LVL 1

Accepted Solution

by:
positronic earned 360 total points
ID: 9682454
This might be useful... it worked on our server...

http://www.webwizguide.info/asp/faq/date_time_settings.asp

If you add:

<%
Session.LCID = 2057
%>

in your ASP, it should cause dates to be displayed in UK format (i.e. dd/mm/yyyy) plus the web link has a list of all the different LCID codes for different locations.

--Simon
0
 

Author Comment

by:keroroza
ID: 9684688
Thanks positronic, it worked. U r a life saver!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question