Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 23rd, 2005, 06:31 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date problem in Access 2003

Hi, there.
I'm trying to execute a simple sql query in Access 2003 and one of my fields is of type date.

I want the date to be stored in format dd/mm/yyyy but Access automatically changes it to mm/dd/yyyy.

All my local settings are dd/mm/yyyy but Access still does the change.

Can U help me?

 
Old December 27th, 2005, 08:32 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

These are the Access instructions for this issue:
"Change the default country/region
Changing the default country/region changes the standard settings for numbers, currencies, time, and date to those most commonly used for that country/region.

On the Microsoft Windows Start menu, point to Settings, and then click Control Panel.

Double-click the Regional Options or Regional Settings icon.

In the Your locale (location) list, select the country/region you want to use as the default.

If you are using Microsoft Windows 2000 and don't see the item you want, first select the check box next to the appropriate language in the Language settings for the system box.

Click OK, and then restart your program.

Note When you change the country/region in the Your locale (location) list, settings, such as the format for displaying currency and date, may also change. Check all the tabs in the Regional Options dialog box to make sure they are correct."

If this doesn't work, you can do the SQL work around and have three columns for the date:

DD = DatePart("d", Date)
MM = DatePart("m", Date)
YY = DatePart("yyyy", Date)

Or sort out the dates in an array by breaking them down and then reassembling them for your code - which is a pain, or breaking them down and reassembling them for display only.

HTH


mmcdonal
 
Old December 28th, 2005, 07:38 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you my friend. I've tried the three column approach and it works fine. A little more work in the sorting SQL statements I use but the problem is solved.

Much appreciated!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Date time picker in access 2003... aboredman Access 1 August 9th, 2007 08:58 PM
Access 2003 Problem allenle37 BOOK: Access 2003 VBA Programmer's Reference 2 May 7th, 2007 11:55 PM
Huge problem with access 2003 andy45 Access 10 May 24th, 2005 10:08 AM
Windows XP ( +access 2003) problem? belete Access 1 October 11th, 2004 09:19 AM
Access 2003 connection problem umzi ADO.NET 4 July 23rd, 2004 01:04 AM





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