472,805 Members | 871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Date formatting dd/mm/yyyy

Hi there,

I've read stacks of articles on this subject in this newsgroup, so
forgive me that this is just another one. I've tried almost all the
suggestions offered, and am still having no luck. I'd really
appreciate any help/advice that can be offered.

I'm trying to obtain and then store all sorts of data, some of which
are dates. In all cases, I would like dates to be in European format
(ie. dd/mm/yyyy). My computer's regional settings are dd/mm/yyyy.

To do this, I have ensured that all the text boxes on my form are in
the format dd/mm/yyyy. All fields in the tables that I am saving to
have the data type 'Date/Time' and their format is specifically
dd/mm/yyyy.

However, when I use the following SQL to save the value in my text box
to the table, the date is automatically converted to mm/dd/yyyy.

"Update TblDetail Set ReviewDate = #" & txtReviewDate.value & "# where
ID = 1"
-- where txtReviewDate.value = 01/05/2003.

If anyone can suggest a simple way of ensuring that exactly what is in
the text box is saved to the table to be exactly the same, that would
be MUCH appreciated! I am trying to avoid actually storing the dates
as text, as any subsequent queries to sort by date would involve
changing all my code to use CDate().

Thanks, Angela
Nov 12 '05 #1
2 11954
Ange, I've been using Access in a country with dd/mm/yyyy dates since
version 1. My experience is that there are three cases where Access gets our
dates wrong. Details:
http://users.bigpond.net.au/abrowne1/ser-36.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Ange T" <sm*************@yahoo.com> wrote in message
news:b7**************************@posting.google.c om...
Hi there,

I've read stacks of articles on this subject in this newsgroup, so
forgive me that this is just another one. I've tried almost all the
suggestions offered, and am still having no luck. I'd really
appreciate any help/advice that can be offered.

I'm trying to obtain and then store all sorts of data, some of which
are dates. In all cases, I would like dates to be in European format
(ie. dd/mm/yyyy). My computer's regional settings are dd/mm/yyyy.

To do this, I have ensured that all the text boxes on my form are in
the format dd/mm/yyyy. All fields in the tables that I am saving to
have the data type 'Date/Time' and their format is specifically
dd/mm/yyyy.

However, when I use the following SQL to save the value in my text box
to the table, the date is automatically converted to mm/dd/yyyy.

"Update TblDetail Set ReviewDate = #" & txtReviewDate.value & "# where
ID = 1"
-- where txtReviewDate.value = 01/05/2003.

If anyone can suggest a simple way of ensuring that exactly what is in
the text box is saved to the table to be exactly the same, that would
be MUCH appreciated! I am trying to avoid actually storing the dates
as text, as any subsequent queries to sort by date would involve
changing all my code to use CDate().

Thanks, Angela

Nov 12 '05 #2
Allen and Steve,

Thank you both so much!! Steve, inserting your simple combination of
format() and ## did the trick perfectly. I should have posted the
question about a week ago when I first started picking up this
problem...

Allen, your URL was really useful in explaining what on earth the
problem was.

Thanks again, vm appreciated! Angela
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
4
by: dhnriverside | last post by:
Hi peeps I have a datepicker control that's providing dates in the format dd/mm/yyyy (UK). I want to convert this to "yyyy-mm-dd" to store as a text field in my database (had lots of problems...
12
by: Rob T | last post by:
I'm storing a date/time into a SQL table of type datetime. I need it to be precise so the value is stored to the 1000th of a second. ie "insert into myTable mydate values ('08/05/2005...
11
by: Lauren Quantrell | last post by:
I already figured out (the hard way) I need to convert all my date parameters into USA format before executing my stored procedures where dates are used as parameters. (Format(StartDate, "m/d/yyyy...
2
by: johndcal | last post by:
Hello All, I have a date value that I pull from a .csv file. After reading the file and storing the values in an array the value of the date could be found in $array, for example....
21
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
9
by: TC | last post by:
Hi. I have some ASP written in VB.net which is currently installed on a customers server. The asp connects to a local MySql database and retrieves data for the customers customers. If you see...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.