Welcome to Forums Sign in | Join | Help | Forums
in Search


Crystal Formula problem

Last post 01-17-2008 11:05 AM by Drew Allen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-17-2008 10:24 AM

    • Philip Scott
    • Top 500 Contributor
    • Posts 31
    • Organization: Children’s Hospital & Medical Center Foundation

    Crystal Formula problem

    I am having trouble with a formula which is producing an error. The formula shows no error when it is checked and saved. I can put it into the detail area of the report and it operates fine. The error only appears if I try to do a summary of the field in the report. The error message is "Bad date-time format string." Here is the formula: Local DateTimeVar d1 := {Gf_Date}; Local DateTimeVar d2 := CurrentDateTime; Local DateTimeVar d3 := CDateTime ({Gf_Gift_status_date}); Local NumberVar n1 := 1; if {Gf_Gift_status} <> "Active" then n1 := DateDiff("m", d1, d3) else n1 := DateDiff("m", d1, d2); if {Gf_Type} = "Recurring Gift" then CCur ({Gf_Amount} * n1) else if {Gf_Type} = "Pledge" then {Gf_Amount} else 0.00 The report is to calculate the projected gifts for both recurring gifts and pledges and then it compares it to the actual gift totals. This formula is for the projected gifts part. Does anyone have any ideas on what is causing the error and how to fix it? If not, does anyone have a solution for calculating expected giving for recurring gifts in a certain time period that they would be willing to share? Thanks for the help.
  • 01-17-2008 11:05 AM In reply to

    • Drew Allen
    • Top 10 Contributor
    • Posts 514
    • Organization: Children's Hospital of Philadelphia
    • Products:  The Information Edge, The Raiser's Edge

    Crystal Formula problem

    The Gift Status Date is a fuzzy date. It can be in one of three formats "MM/DD/YYYY", "MM/YYYY", or "YYYY". Your formula is only accounting for this first format, so you are getting errors for a date in one of the other formats. Drew J. Drew Allen Children's Hospital of Philadelphia [Email Removed] Check out the user run RE Forum at http://www.blackbus.org/ . Check out the Crystal Reports blog "Crystal Clear" at http://www.blackbus.org/blogs/viewblog.php?userid=63
    J. Drew Allen
    The Children's Hospital of Philadelphia
Page 1 of 1 (2 items)