CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    20

    MS Access Parsing Date

    Hi,

    I have field in an Access database whose datatype is text.

    It contains various dates, some of which are in Y-MM-DD (e.g. 20011231), while the rest are only in Year format (e.g. 1999).

    How can I modify this field so that the dates in Year format (such as 1999) are converted to Year(as specified in field)Jan1 (e.g. 19990101). So that the format for the field is either Y-MM-DD or some numeric format (such as double)

    Thanks,

  2. #2
    Join Date
    May 2003
    Location
    upstate NY
    Posts
    168

    Re: MS Access Parsing Date

    maybe this site can help ya out

    MS ACCESS
    --------------------------------------------
    Tell me and I will forget
    Show me and I will remember
    Teach me and I will learn

  3. #3
    Join Date
    Oct 2005
    Location
    England
    Posts
    803

    Re: MS Access Parsing Date

    try

    Code:
    SERIAL = format(date, "general number")
    This will convert a date into a date serial, date number 1 is january the 1st 1989 (i think) and they have been numbered like that ever since. Today we are on something like 36000.


    then to get the date back

    Code:
    cDate(serial)
    Rich

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

Featured