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 1:40AM
    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 1:40AM
    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 1:40AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.