Crystal Reports - How to Combine Two Formulas

Posted on 2009-02-20
Last Modified: 2012-05-06
Hi Experts,

I'm trying to combine two formulas for one data element.  How can I combine the following statement?

{table_visit} in 20090101.00 to 20090131.00
{table_visit} in 20080101.00 to 20080131.00

What should appear is a name of a person who visited our location once in the month of January 2009 and once in January of 2008.

Question by:byd2k
    LVL 100

    Expert Comment

    Use OR instead since obviously a single date field cannot be in both ranges.


    Author Comment

    Part of the criteria is two date ranges.

    If this person visited us sometime in January of 07 and sometime in January 08, show their name on the report.
    LVL 100

    Accepted Solution

    Selectionis done one record at a time so unless you have 2 date fields you will have to select all people who visited in either range then suppress those who only visited in one range.

    Depending on the database you may be able to do something like

    SELECT A.Name, A.Date, B.Date
    FROM VisitTable A INNER JOIN VisitTable B ON A.Name = B.Name
    Where A.Date In 20090101.00 to 20090131.00
    AND B.Date IN 20080101.00 to 20080131.00

    Are the dates stored as numbers?


    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

    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…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    728 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

    24 Experts available now in Live!

    Get 1:1 Help Now