Results 1 to 4 of 4

Thread: Formatting a date

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    15

    Formatting a date

    Hi,

    One of the fields in the report I'm trying to create is date field which as a date in the format mm/dd/yyyy (e.g. 12/25/2007). Is there any way that I can display the date as, for example, December 25, 2007 instead of 12/25/2007.

    Also, I need this to be done for axis labels on a chart.

    Thanks in advance!
    Last edited by rftd; Jun 27th, 2008 at 11:51 AM.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Formatting a date

    Use the function ToText

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Formatting a date

    The following characters are used to create format strings for Date, Time, and DateTime values:

    ToText({Table1.Date1},"dd-MMMM-yy")

    Character Comments
    d day of month without leading zero for single digits
    dd day of month with leading zero for single digits.
    ddd day of week as a three letter abbreviation
    dddd full name of day of week
    M month without leading zero for single digit
    MM month with leading zero for single digit
    MMM month as three letter abbreviation.
    MMMM full name of month
    yy l ast two digits of year
    yyyy full four digits of year

    JG

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    15

    Re: Formatting a date

    Thanks for the help, but another issue that comes up here is that when I use the ToText function, I can no longer 'order' the dates in a graph/chart. For example, whereas with the normal date field I could order the data by every 10mins, 1hour, day, etc, crystal reports doesn't seem to recognize the 'ToText version' of the date as being an actual date. As such, for instance, I cannot set my bar graph to consider the date in 1-minute intervals.

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