FORMATDATETIME

Hi,

I am trying to get a line similar to this to print out: "Report Name - April 2004". I am trying to place this code in the Memo property of a TfrMemoView object: Report Name - [FORMATDATETIME(MMMM, DATE)] [YEAROF(DATE)]. When I go to preview my report, I get an error.

The error states: "Undefined symbol "MMMM". I don't understand. When I look the parameter for that format option, "MMMM" is valid.

Is this a bug? Or am I simply missing someting ;)

Randel

Comments

  • edited 4:14AM
    The formatting expression is STRING. So You have to enclose it in apostrophes.
    [FORMATDATETIME('MMMM', DATE)]. But if You need date formatting You can use the following method:
    [DATE #Dyyyy.mm.dd.] where the # tells the engine to interpret the followings as the formatting expression, D means that the formatting is a date-format. The letters of the expression and the '.' mean the same as Delphi's FormatDateTime function's parameters.

    Regards:Alex
  • edited 4:14AM
    I knew it was a string, but I just could not get it to work. Now I know it was because I was trying to put it between double-quotation marks ("..."). That caused me to get the same, but different, error message. The message had the format parameter was then surrounded by two sets of double-quotes: (""..."").

    I thought I had tried single-quotes, but I must not have. Thanks for your help.

    Randel ;)
  • edited 4:14AM
    I use ver 2.42 and both of the above examples work fine without any errors and gives the correct and same result. I mean I used [FORMATDATETIME('MMMM', DATE)] and [DATE #Dmmmm] and they are the same in the result.

    Alex

Leave a Comment