Print Page | Close Window

UK/US Access Date headache

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5075
Printed Date: 30 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: UK/US Access Date headache
Posted By: redk
Subject: UK/US Access Date headache
Date Posted: 16 August 2003 at 3:47pm

Im afraid its good old Date format and Access again folks (sorry)

Im making a list of league fixtures and coming across problems when updating individual fixtures because of the way that the form textfield reads in and updates the date.

When im entering a fixture from scratch, i can write '10 Jun 03' in the date textfield and sure enough, it will show on my asp page as '10/06/03' - and thats cool - great.

But when i need to update that fixture (like, to put in the score), I read in the details and in the date box, it reads '10/06/03' (which you would still think is ok BUT, when i update it this time, it goes in as '06/10/03' US style -aaarrrgghhh!!! - Its doing my head in!
(incidentally, at this point, should i have to update it again, it would read it in as '06/10/03' this time and when entered again, it would sort itself back to the correct intended '10/06/03')

Ive scoured the net for a solution to fit but, cant find one (there are loads of solutions if the date is simply "Now()" but, its not! in this instance :(

Other solutions ive tried are the LCID route but, that didn't work either! I was ready for making the field text only but, i cant coz i need the entire fixture list to be sorted by date aaarrrggghhh!

Please help

thanks

RedK




Replies:
Posted By: b_bonnett
Date Posted: 19 August 2003 at 4:52am

I think that there is an option within Access for the date format when you create the field. Its weird that it changes each time you update though. I would have thought that if you set the LCID correctly and used the FormatDateTime function then it should turn out fine... .

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: redk
Date Posted: 19 August 2003 at 6:30am

Thanks for replying :)

Changing the format within Access is irrelevant as it simply stores the date as a number anyway (days since 01/01/1899 or similar) So the date in access is like "36457" for 10th June 03 kinda thing no matter whether you want it as 10/06/03 or 06/10/03 - Access will have it as 36457!

The LCID is definitely set correctly - Ive got it in global.asa AND in each file just to be sure :(

Anyone any other ideas please?

thanks

Red..



Posted By: dpyers
Date Posted: 19 August 2003 at 11:31am

When you say "entering a fixture from scratch" -  are you directly editing the db through ms access, or adding a new entry through a web form?

You've got three factors to synchronize...

  1. Codepage of server
  2. Codepage of client pc
  3. Charset specified by metatag on each of the web pages

You may also want to check out...

  • response.codepage
  • server.codepage
  • post.codepage


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: redk
Date Posted: 19 August 2003 at 11:51am

Yes - Im entering it through a web form.

e.g - I enter 09/Aug/03 into the form and it goes into Access as 09/08/03 - thats great. When i try to update this fixture (through another webform) it firstly, reads its value back in as 09/08/03 (instead of 09/Aug/03) and this is where my problem is. Because this time, when i enter it, (and dont ammend it) it goes in as 08/09/03 automatically - see whats happening now?

Its driving me nuts my friend - any help most appreciated :)

Red..



Posted By: b_bonnett
Date Posted: 20 August 2003 at 4:19am

Question time: If you originally insert it in US format, does it still change each time you update it?

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: dpyers
Date Posted: 20 August 2003 at 6:06pm

I think I'd hit it the hard way...

in the meta tags for the new and the update pages, specify the charset

Use the corresdponding codepage (server.codepage=) in the asp page for the new and update pages, and in the formhandler pages for each one.

If it doesn't work, I'm going back under my rock.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Bunce
Date Posted: 21 August 2003 at 3:54am

Best bet is to use a generic date formatting routine used going IN and OUT of the database.. and format your dates internally using ISO format..

http://adopenstatic.com/faq/DateswithAccess.asp - http://adopenstatic.com/faq/DateswithAccess.asp
http://adopenstatic.com/resources/code/formatdate.asp - http://adopenstatic.com/resources/code/formatdate.asp
http://adopenstatic.com/faq/systemdateformat.asp - http://adopenstatic.com/faq/systemdateformat.asp
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q229/6/90.asp&NoWebContent=1 - http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q229/6/90.asp&NoWebContent=1

(got my name at the bottom of one of them!!  )

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: redk
Date Posted: 21 August 2003 at 6:23am

Hey,

Thanks everyone for their solutions - Ive finally got it sorted but, still feel ive went the long way about it.

What i did was, I made 3 new fields in my db (day, month & year) giving me them plus a date 'field'.
I then used dropdowns to select the dates instead. This way, i can be assured that its being entered as 10 Aug 03 and having those three extra fields allows it to be read back in the same way when im updating.

I then used two hidden fields that simply contain a forward slash "/" and the field called 'date' takes the info from [day, hidden1, month, hidden2, year] This way, when i disply the fixture list, i can simply request 'date' from the db and still have it written as the normal 10/06/03 :)

Thanks very much to everyone who went to the trouble of replying - It was really appreciated!!!!

Red..



Posted By: Bunce
Date Posted: 21 August 2003 at 6:43am

well, yep that will work but its the long way round.

Those articles I posted have all the answers you need.  When you get a chance you should read through them..

Good luck!



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: redk
Date Posted: 21 August 2003 at 7:02am

oh, i intend to Bunce - Its been annoying me for too long to settle for the quick fix now hehehe! The problem has just been going on too long and i had to find a solution and move on. I will study what you gave me and go back at a later time and sort out the code'n.

thanks again :)

Red..




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net