Format Date/Time field in Crystal Reports

Posted on 2005-04-28
Last Modified: 2011-10-03
I am using the folloing formula to populate a 'data date' for a report:
formula = "Data Dates from " + totext(minimum({@closed time})) + totext(maximum({@closed time}))
The output in crystal is good:
Data Dates from 4/1/2005 13:59:49 to 4/27/2005 14:43:13
But, when I run put the report in a project the output changes to:
Data Dates from 05-04-01 01:59:49 PM to 05-04-27 02:43:13 PM

This date is confusing to users so I would like the output to be MM/DD/YYYY not YY-MM-DD, how do I go about formatting this??
Question by:mikevere
    LVL 34

    Accepted Solution

    try this to force the format...

    formula = "Data Dates from " + totext(minimum({@closed time}), "M/d/yyyy HH:mm:ss") + " to " +
         totext(maximum({@closed time}), "M/d/yyyy HH:mm:ss")
    LVL 100

    Expert Comment

    That looks like the way to go.  Would appear in Crystal it is using your Crystal defaults but from VB your system default formats.


    Author Comment


    I ended up using:
    formula = "Data Dates from " + totext(minimum({@closed time}), MM/dd/yyyy) + " to " +
         totext(maximum({@closed time}), MM/dd/yyyy)

    Works great, thanks!!

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now