Date Formatting Issue

Ask a Question related to Microsoft Access, Design and Development.

  1. #1

    Default Date Formatting Issue

    I have Access 2000. On a form, I want to show (in an
    unbound text box) how long an agreement has been effect,
    and format it in years and days.

    The formula so far with this control reads:

    =(Date()-[Bulk_Agreement_Start_Date])/365.25

    This converts months (etc) to fractions of a year, so if
    the length is 2 years 6 months, it would show up as 2.5
    years.

    How do I format it so it would say "2 years, 6 months" or
    maybe as "30 months?"

    LRH
    Larry R Harrison Jr Guest

  2. Similar Questions and Discussions

    1. Date Formatting
      Use the Day function. response.write day("12/1/2003") Of course, is that date the first of December, or the twelth of January? I suggest you...
    2. formatting a date in cfselect
      Assuming a query "meetingdate" that grabs a unique value of the 'meetingdate' field (a date/time field). In a form, that query is used to populate a...
    3. formatting date() and nbsp;
      What I have is a date that I'd like to format to keep it together on one line using non-breaking spaces. I started with: date...
    4. formatting date
      On 30/7/03 2:18 PM, in article bg7guu$b7j$1@forums.macromedia.com, "JemJam" <webforumsuser@macromedia.com> wrote: The systemDate object will...
    5. Date - formatting
      I'm needing to assign the following variable with the following data from the date. Does anyone have any help they could offer please? date_day =...
  3. #2

    Default Re: Date Formatting Issue

    Larry,
    For total number of months:
    =DateDiff("m",[Bulk_Agreement_Start_Date],Date())
    1/6/199 to 7/9/2003 will return 54.

    To break it down to years and months in one control:
    =Int(DateDiff("m",[Bulk_Agreement_Start_Date],Date())/12) & " year(s) & " &
    DateDiff("m",[Bulk_Agreement_Start_Date],Date()) Mod 12 & " month(s)"

    so 54 months will read
    4 year(s) & 6 month(s)

    Note: the DateDiff("m",Date1,Date2) function returns 1 for each change in
    the month, not necessarily each 30 days, i.e. 1/31/2003 to 2/1/2003 is 1
    month.

    --
    Fred

    Please reply only to this newsgroup.
    I do not reply to personal e-mail.


    "Larry R Harrison Jr" <larrytucaz@yahoo.com> wrote in message
    news:9a8401c34637$4b2cd200$a401280a@phx.gbl...
    > I have Access 2000. On a form, I want to show (in an
    > unbound text box) how long an agreement has been effect,
    > and format it in years and days.
    >
    > The formula so far with this control reads:
    >
    > =(Date()-[Bulk_Agreement_Start_Date])/365.25
    >
    > This converts months (etc) to fractions of a year, so if
    > the length is 2 years 6 months, it would show up as 2.5
    > years.
    >
    > How do I format it so it would say "2 years, 6 months" or
    > maybe as "30 months?"
    >
    > LRH

    Fredg Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139