Solved

Crystal Reports 2008 Formula Question

Posted on 2011-02-16
6
1,188 Views
Last Modified: 2012-05-11
I have a formula that deperates data by the previous 3 months. It works great except iit does not remove the rest of the data not needed. Can some one tell me what I need to add to it so it disregaursds the rest of the data I do not need.

if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate),1) to currentdate then totext(dateserial(year(currentdate),month(currentdate),1),"MMMM yyyy")else
if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate)-1,1) to dateserial(year(currentdate),month(currentdate),1)-1 then totext(dateserial(year(currentdate),month(currentdate)-1,1),"MMMM yyyy")else
if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate)-2,1) to dateserial(year(currentdate),month(currentdate)-1,1)-1 then totext(dateserial(year(currentdate),month(currentdate)-2,1),"MMMM yyyy")
0
Comment
Question by:Nathan Webb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 12

Expert Comment

by:JayConverse
ID: 34910799
You'll have to explain some more.  What does "it does not remove the rest of the data not needed" mean?  Give some examples.
0
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 34910974
if you're using a SQL query to pull your data into the report, you could limit data to only those records that are within the last 3 months by using date criteria in the WHERE clause.

example

....
WHERE RegisteredMembers.RegisteredTime >= DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP) - 3, 0)
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 34911004
The formula you are using is simply to use in the report.  You aren't using it to filter the data so you need a filter as suggested above.

mlmcc
0
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.

 
LVL 43

Accepted Solution

by:
zephyr_hex (Megan) earned 250 total points
ID: 34911036
oops... also meant to say

if you are not using SQL Query / Command,
you could use a Report Selection formula that limits the records to only those in the last 3 months.

{RegisteredMembers.RegisteredTime} >= dateadd('m',-3,today())
0
 

Author Comment

by:Nathan Webb
ID: 34915767
So would I add the string to the formula I posted above?

if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate),1) to currentdate then totext(dateserial(year(currentdate),month(currentdate),1),"MMMM yyyy")else
if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate)-1,1) to dateserial(year(currentdate),month(currentdate),1)-1 then totext(dateserial(year(currentdate),month(currentdate)-1,1),"MMMM yyyy")else
if {RegisteredMembers.RegisteredTime} in dateserial(year(currentdate),month(currentdate)-2,1) to dateserial(year(currentdate),month(currentdate)-1,1)-1 then totext(dateserial(year(currentdate),month(currentdate)-2,1),"MMMM yyyy") else
if {RegisteredMembers.RegisteredTime} >= dateadd('m',-3,today())


Thansk
0
 
LVL 12

Assisted Solution

by:JayConverse
JayConverse earned 250 total points
ID: 34915793
No, you add it to the Record Selection formula.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 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