UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Force To Input And Save Date As Dd/mm/yyyy, Access 2007    
 
   
JonSmith
post Oct 11 2018, 02:46 AM
Post#21



Posts: 3,910
Joined: 19-October 10



QUOTE
Thanks everyone for your reply. I could not explain the subject clearly. No matter how the computer ‍saves date, but entry data in the date field in my desired way is essential. I want to entry date as dd/mm/yyyy format. Is there any way please. Sometimes it is giving wrong information. I've set my date field format as dd/mm/yyyy. Now, if I entry 01/05/2018 (01 May 2018) then access converts it as 05 Jan 2018 . Is there any solution please? Otherwise I've to use Text data type for the date field.


Did you read my first response. I went it alot of detail about where your code was incorrect and told you how to go forward and correct it.
In further posts we've all discussed how to handle dd/mm/yyyy formats. If your control is bound then there should be no need to worry about regional settings so you must be saving the date in some other way.

You don't need to use a text data type. The solution you ask for again is already above your post, I'm not going to repeat it so I would ask you to read it again properly and post back with specifics about any parts you find unclear or struggle to implement.
Go to the top of the page
 
GroverParkGeorge
post Oct 11 2018, 07:07 AM
Post#22


UA Admin
Posts: 33,760
Joined: 20-June 02
From: Newcastle, WA


While there is sometimes a problem when language differences are involved, we seem to be dealing with an additional level of problems.

First, Dates are stored in Access differently from strings. I think we all know that, but part of our problem seems to be that we are not actually taking that into account.

Simply concatenating strings together in a specific sequence doesn't turn them into dates.

We, humans, are used to seeing that kind of ambiguous string and interpreting them appropriately.

Computers in general, and Access in particular, are NOT good at resolving ambiguous strings. Access does do a lot to try to help. However, it is not really going to be perfect, at least not in the sense that Access always guesses what YOU intend.

Therefore you must be very explicit in telling Access how to handle input.

You can have three controls on a form, as you want. But you must ALSO tell Access very explicitly how to CONVERT the strings in those controls into a VALID date in the FORMAT you want to see.

The DateSerial() function does that. Concatenation does NOT do that.

At least one previous post pointed out how to use DateSerial to convert the values from your Month control, Day control, and Year control. Use that.

Store the converted date in a date field in the table.

You can FORMAT those dates in many different ways, once you have them stored as dates.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 
GroverParkGeorge
post Oct 11 2018, 07:10 AM
Post#23


UA Admin
Posts: 33,760
Joined: 20-June 02
From: Newcastle, WA


A few months ago I created a short YouTube video on dates that may be interesting with regard to FORMATTING.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 
mitsbd
post Oct 12 2018, 08:58 AM
Post#24



Posts: 19
Joined: 23-May 18



JonSmith,
I've read all the previous comment. But unfortunately could not solve my problem. I think it's my incapacity. Today I'll try to do it watching the video of GroverParkGeorge.
Thank you all for your help.
Regards.
Go to the top of the page
 
JonSmith
post Oct 12 2018, 09:20 AM
Post#25



Posts: 3,910
Joined: 19-October 10



QUOTE
post back with specifics about any parts you find unclear or struggle to implement.


Do this then?
We cannot help you unless you tell us what you tried. We posted methods we know will work so just hearing you couldn't use them doesn't leave us much info to help you move forward.

Tell us and show us what you tried and what isn't working and I am sure we can work this out.
Go to the top of the page
 
2 Pages V < 1 2


Custom Search
RSSSearch   Top   Lo-Fi    17th October 2018 - 03:51 PM