Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Acess 2010 date problem

    I have 2003 and 2010 installed by the microsoft library is 14 for both programsť

    I am using the dateserial function, I wanted the date : January 1, 2011
    so the textbox =dateserial(2011,1,1) but the function generates the date as 1905-07-01.
    Last edited by r3x3; 2011-03-29 at 16:03.

  2. #2
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts
    Hi
    I have just tried this on Access 2010
    I made a form containing 2 text fields
    I named one textDate and populated it with 2011
    Using the immediate window I typed
    ? dateserial(forms!form1!textDate,1,1)
    and the Result was
    1/01/2011

    I set the data source in the 2nd field to
    =DateSerial(textDate,1,1)
    and all was correct.

    You seem to be doing things correctly.

    Sorry I havent answered your problem.

    Geof

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts
    thanks for trying but it seems rather than using 2011, I am getting the date value from 1900

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Are you able to post a demo of the problem.
    Regards
    John



  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    In Access 2010, I enterred in the immediate window the expression ?dateserial(2011,1,1) and it returned 1/1/2011.

    How is that textbox you have formatted?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    WS Lounge VIP Browni's Avatar
    Join Date
    Dec 2009
    Location
    Rochdale, UK
    Posts
    1,653
    Thanks
    38
    Thanked 161 Times in 139 Posts
    What do you get if you try dateserial(1,1,2011) ?

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by Browni View Post
    What do you get if you try dateserial(1,1,2011) ?
    I tried that:

    Code:
    ? DateSerial(1,1,2011)
    4/07/2006
    DateSerial expects its parameters to be, in order, Year, Month and Day.

    But I just put in 1 for year, it treats it as 2001.
    So I have asked for the 2011th day in January 2001. So it then moves 2011 days forward from then and end up half way through 2006.
    Regards
    John



Posting Permissions

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