Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Crystal Reports 2008 Formula Question

Posted on 2011-02-16
Medium Priority
1,190 Views
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
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

LVL 12

Expert Comment

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 44

Expert Comment

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

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

LVL 44

Accepted Solution

zephyr_hex (Megan) earned 1000 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.

0

Author Comment

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

Thansk
0

LVL 12

Assisted Solution

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

## Featured Post

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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
###### Suggested Courses
Course of the Month8 days, 15 hours left to enroll