Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Crystal Reports - How to Combine Two Formulas

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.

  • 2
1 Solution
Use OR instead since obviously a single date field cannot be in both ranges.

byd2kAuthor Commented:
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.
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now