Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert Date to Text (Access 2002)

    Hello Everyone!

    Congrats to USA's win in Little League! Great Job....Go Kentucky!

    Now on to business......

    My date field is setup as 8/26/02. In my report I will be joining two fields, one of them will be the date field. I don't want the date to appear as 8/26/02, rather as "August 26, 2002". What do I need to do to convert this over in the report. I don't think I need to write any special code, but if I have to, I will.

    Thanks all for your help.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert Date to Text (Access 2002)

    Thanks Hans...exactly what I needed!
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Convert Date to Text (Access 2002)

    In a text box bound to the date field, you can set the Format property to "mmmm d, yyyy" (without the quotes).

    In a text box concatenating two fields, you can use the Format function in the control source:

    =[SomeField] & " " & Format([DateField], "mmmm d, yyyy")

    Note: I don't know how complete the online help for Access 2002 is on this subject. Here is the list of symbols you can use for dates in Format:

    <table border=1><td>Symbol</td><td>Meaning</td><td>Values</td><td>d</td><td>Day number without leading zero</td><td>1 .. 31</td><td>dd</td><td>Day number with leading zero</td><td>01 .. 31</td><td>ddd</td><td>Abbreviated name of day</td><td>Sun .. Sat</td><td>dddd</td><td>Full name of day</td><td>Sunday .. Saturday</td><td>m</td><td>Month number without leading zero</td><td>1 .. 12</td><td>mm</td><td>Month number with leading zero</td><td>01 .. 12</td><td>mmm</td><td>Abbreviated name of month</td><td>Jan .. Dec</td><td>mmmm</td><td>Full name of month</td><td>January .. December</td><td>yy</td><td>Two digit year</td><td>02</td><td>yyyy</td><td>Four digit year</td><td>2002</td></table>

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

    Re: Convert Date to Text (Access 2002)

    FYI, this is one case where the A2002 help actually works - type "date formatting" in the Answer Wizard and it acutally comes up with all the gory details about how you can format a date.
    Wendell

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert Date to Text (Access 2002)

    Hello Again!

    I want to add a twist to the original question and I doubt this can be done....but I will give it a shot!

    The date field property is set to bold...the other field isn't. The Undbound txtbox that joins the two should appear: "blah blah blah (unbold) on August 26, 2002 (bold)".....can this be done in the formating of the code Han's provided?

    Thanks!
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Convert Date to Text (Access 2002)

    Not with the standard Access text box - you can only apply text formatting to the text box as a whole.

    It is possible to apply formatting to parts of text in a Rich Text control, but I wouldn't bother. You'd have to write lots of code to control the formatting.

    What you could do it put two text boxes next to each other, with a transparent border. Make the one on the right bold. If you like, you can make the text in the one on the left right-aligned and vice versa. That's as near as you can get without programming...

  7. #7
    Lounger
    Join Date
    Nov 2001
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert Date to Text (Access 2002)

    You could use UCase on the formatted date, not perfect but close

Posting Permissions

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