Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 December 12th, 2003, 03:16 AM
Registered User
 
Join Date: Dec 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date Problem

Hi everybody

Again I am facing some problem with date format.

By default Access Format is mm/dd/yy

But I want to store and show the date format as dd/mm/yyyy.

Pl advice me.

thanks
Subho

 
Old December 12th, 2003, 05:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once more with feeling...:D:D:D

Access doesn't store dates in a human recognisable format.

Dates are stored as numbers. The integer part of the number records the date - by showing how many days after a certain fixed date it is.

The decimal part of the number records the time as a fraction of a whole day.

Whenever a date is displayed Access goes through a translation routine and converts this number into a recognisable date\time. When you change a record it reverses the translation and converts it back into a number.

The default format for display is taken from the Windows regional settings - The short date format I think. So, if your short date format is set to dd/mm/yy then all your dates will be displayed as dd/mm/yy, unless you override it using a formatting command.

In short, whenever you display a date to the user set the format to dd\mm\yyyy and that's what they'll see!


Brian Skelton
Braxis Computer Services Ltd.
 
Old December 14th, 2003, 01:22 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Subho,
Just to elaborate, for the field you wish to format, go to the properties dialog box, under format & you can choose from the predefined list of formats, or define your own.
You can also ensure proper formatting on entry, with an "Input Mask",
from the same dialog box under "Data".
You can even, have it entered in one format & have it displayed in another. eg; use a shorter, easier, or more intuitive format for entry (Input Mask), but it will be displayed as you dictate with the format property.
Sorry, if you knew this already?






Similar Threads
Thread Thread Starter Forum Replies Last Post
DATE PROBLEM ricespn Classic ASP Basics 3 October 20th, 2006 07:15 AM
Date Problem. rupen Classic ASP Basics 3 June 3rd, 2005 09:58 AM
Date Problem tdaustin Classic ASP Basics 10 August 13th, 2004 01:43 PM
date problem hosefo81 PHP How-To 2 May 26th, 2004 11:12 AM
Date problem Larson VB How-To 2 December 30th, 2003 06:10 PM





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