-
I have a problem retrieving date from database .
And it dosen't happen in every computer.the problem is when I enter date 01/05/1999 and save it in access.After that i retrieved it but it became 05/01/1999.How can i solve this.It's make my program incorrect..Has anybody found this problem or someone can solve it .Please help me
-
Dates in an Access database are m/d/y. How are you reading the date? Can you post some of your code?
------------------
Marty
-
I put the data from recordset to text box directly.
for example :
Maskbox1.text=Format(Rs!DocDate,"dd/mm/yyyy")
-
Hi there..
1- Try entering you dates as 12/28/1999 to avoid confusion while designing/testing.
2- In your code: Maskbox1.text=Format(Rs!DocDate,"dd/mm/yyyy") Try "mm/dd/yyyy".
Good Luck.
-
Your quite correct that dates are coming from some machines in dd/mm/yyyy format. I have the reverse problem with some machines giving me dates in mm/dd/yyyy format.
The problem is dates in the good ol USA are expressed as month day year, whereas in the rest of the world the standard day month year.
Our answer is that our America clients switch there PCs (regional settings) to Australian date formats. Perhaps you have some PCs set to ozzie or british settings.
-
Try changing your date field to a text field and manipulate the dates in VB code!
Works for me!
-
Thank you very much everybody for replying my question. I think my problem have caused like jritchie said but althought I changed the regional setting to be the same in 2 computers.It does't work.(It's still the same) I doubt that it's cause by machine or window version.
-
Pavinda,
Have you got any date formating commands in the vb app, these maybe over-writing the regional settings. We finally resolved the problem by having the data packages identified as either American or Australian. A bit messy but it works.
-
Hey there Pavinda...
I don't know whether this would help or not.. but I've an .ocx that called Grandvida Input Control... I use it for date data...
If u want it, plz contact me ([email protected])
ok ???
Hopefully this would help you..
Brgds
Wille
Junior VB Programmer
-
hello Friends
This prob is of acces only. Even ifit is storing the data in DD/MM/YYYY format and works fine when u enter data directly in access is works fine, but the moment u try to access data froma vb application it creates problems, Access internally converts the date. like if u enter the date as 5/11/1999 it will change this to 11/5/199 this prob also appeares when u send a sql script using vb program or even if u use modules in access only. I too found this wrong so wheneevr i beed to wrk with access databasei store the date as number(long) in the folloing format YYYYMMDD and convert this to date format in my vb application, yes its will increase yr wrk load...but will eliminate the date problem. By using this u can also use between in the sql statement it will work fine as well as u can also sort the date on the basis of date.
Thanx Manish