Drew Wutka
DWUTKA at marlow.com
Fri Sep 19 11:05:24 CDT 2003
Connie, you really need to ignore date formatting when you are in code. A date is actually a double variable (the whole part is the day (since Dec.30, 1899 (maybe Dec. 31st, I'm a little groggy this morning! <grin>)), and the decimal is the fraction of the day (.0 is midnight, .5 is noon, etc.)). There are two functions, DateSerial and TimeSerial, which have the order of the arguments constant no matter what region of the world you are in. So, when making a date variable, you should set the variable with DateSerial, which asks for a year, month and day. You now have a date variable representing the date you want, and you can display it any way you wish, but to Access/VBA, it is the date you set, no matter what the format. Drew -----Original Message----- From: connie.kamrowski at agric.nsw.gov.au [mailto:connie.kamrowski at agric.nsw.gov.au] Sent: Thursday, September 18, 2003 10:22 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Date issues in Access That works for display of the data but it is still returning incorrect results from the formula because the date is passed incorrectly if it is before the 12th of the month Connie Kamrowski Analyst/Programmer Information Technology NSW Agriculture Orange Ph: 02 6391 3250 Fax:02 6391 3290 |---------+------------------------------------> | | "Stuart McLachlan" | | | <stuart at lexacorp.com.pg> | | | Sent by: | | | accessd-bounces at databasea| | | dvisors.com | | | | | | | | | 19/09/03 11:42 AM | | | Please respond to Access | | | Developers discussion and| | | problem solving | | | | |---------+------------------------------------> >--------------------------------------------------------------------------- -----------------------------------| | | | To: Access Developers discussion and problem solving <accessd at databaseadvisors.com> | | cc: | | Subject: Re: [AccessD] Date issues in Access | >--------------------------------------------------------------------------- -----------------------------------| Use Format$(mydate,"dd/mm/yy") in your messagebox. On 19 Sep 2003 at 11:03, connie.kamrowski at agric.nsw.go wrote: > Hi Everyone, > > I am a newbie to thsi list but am at my wits end. > I have a problem with Dates in Access. It is happening in two seperate > applications. > I am in Australia and need to have the Date format as dd/mm/yy. > > When a date is entered into a field it is displayed correctly ie. 06/08/02 > > when it is returned to me via a msgBox popup for troubleshooting it is > displayed as 08/06/02 (US Format). > when the date is after the 12th of the month it is all working fine. It > only reverts to US format if the date is before the 12th. > I am in Australia and need to have the Date format as dd/mm/yy. > > Thanks > Connie Kamrowski > Analyst/Programmer > > > > This message is intended for the addressee named and may contain > confidential information. If you are not the intended recipient or > received it in error, please delete the message and notify sender. Views > expressed are those of the individual sender and are not necessarily the > views of their organisation. -- Stuart McLachlan Lexacorp Ltd Application Development, IT Consultancy http://www.lexacorp.com.pg _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient or received it in error, please delete the message and notify sender. Views expressed are those of the individual sender and are not necessarily the views of their organisation. _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com