Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting dates (2003)

    I know this is simple, I just cannot remember how to make it happen...
    All I want in my field is a 2-digit year. It will be part of a client ID number.
    If the client is new as of today their number might look like 050001.FAM.0001
    The "05" is a seperate field because the client may have been active a couple years already and we want to change the "05" to "04" or "03". But I want to keep that leading "0".

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting dates (2003)

    If the field is a number field, set its Format property to 00. This only influences the display, not the stored value.
    In the expression used to concatenate the client number, use Format([TheYear], "00") & ... where TheYear is the name of the year field.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Formatting dates (2003)

    It looks like you may be reinventing the Y2K problem everyone worried about 5 years ago. Suppose someone became active in 1998? I realize that it's nearly 100 years before we have to deal with Y2.1K, but I would certainly store a full 4 digit year, or alternatively store the actual date (in a date field) a client became active, and then use the Year() function to extract just the year and format that as a two digit number with a leading zero where necessary.
    Wendell

  4. #4
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting dates (2003)

    Hans suggestion worked wonderfully... thanks.
    Wendell, I actually do have the full date the client became active stored. Good idea.

Posting Permissions

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