Results 1 to 10 of 10

Thread: I have an headache with date data type.Anybody can help?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Thailand
    Posts
    20

    Post

    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

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Dates in an Access database are m/d/y. How are you reading the date? Can you post some of your code?

    ------------------
    Marty

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Thailand
    Posts
    20

    Post

    I put the data from recordset to text box directly.
    for example :
    Maskbox1.text=Format(Rs!DocDate,"dd/mm/yyyy")


  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226

    Post

    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.

  5. #5
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178

    Post

    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.

  6. #6
    New Member
    Join Date
    Nov 1999
    Location
    South Africa
    Posts
    4

    Post

    Try changing your date field to a text field and manipulate the dates in VB code!
    Works for me!

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Thailand
    Posts
    20

    Post

    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.

  8. #8
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178

    Post

    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.

  9. #9
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Post

    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

  10. #10
    Lively Member
    Join Date
    Apr 1999
    Location
    India
    Posts
    73

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width