Sage 100

 View Only
  • 1.  controlling date format in Crystal formula m/d/yyyy

    Posted 09-02-2022 08:58
    Argh, losing my patience.  I'm trying to achieve m/d/yyyy in a Crystal formula.  The closest I got was this, ToText(Cdate({SO_SalesOrderWrk.PromiseDate}),"M/d/yyyy"), although it returns 4/ 8/2022 (notice the space in front of the day; can't figure out how to prevent that).

    ------------------------------
    Brett Zimmerman
    Net at Work
    Greater Boston Area
    ------------------------------


  • 2.  RE: controlling date format in Crystal formula m/d/yyyy

    Posted 09-02-2022 11:57
    Hmmm, I guess i nearly always use the "MM/dd/YYYY" form so I get the leading zeros... I hadn't noticed a leading space.

    Have you tried using the Replace() function to remove the space?  Also, probably not important, but is Cdate() necessary?  Isn't PromiseDate already a date field?

    i.e.   replace (ToText(Cdate({SO_SalesOrderWrk.PromiseDate}),"M/d/yyyy")," ","")

    ------------------------------
    Randy Marion
    ------------------------------



  • 3.  RE: controlling date format in Crystal formula m/d/yyyy

    Posted 09-02-2022 12:41
    Thanks, Randy!  Looks like that might do the trick as I also just found this: https://stackoverflow.com/questions/25428506/leading-blank-space-converting-date-to-string-in-crystal-reports.  Yes, I probably don't need Cdate; I had tried it with and without, same result.


    ------------------------------
    Brett Zimmerman
    Net at Work
    Greater Boston Area
    ------------------------------