Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Date Formula Needes Post Reply Post New Topic
<< Prev Page  of 3 Next >>
Author Message
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 10:36am

my new criteria is that we lost WITHIN the last 5 years--and we have not invoiced since dec 2008

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 11:14am
Do you need help adding that criteria in?
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 11:14am
Yes SIR...plz..my mind is drying out...with all these reports
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 11:23am
That has me confused.
We defined "lost" as no invoice date in the last 5 years, correct?
and they want no invoice date since Dec 08? Whay not just use that instead of the last 5 years? What did I miss here?
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 11:24am
lol...
 
I have so so all account where we have not invoiced within the last 5 years (so if we invoice in 2002--dont' show me the account AND if we invoiced in 2009 dont show me the account)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 11:41am
Now my mind is dried out....
I can't follow. I need some sample data that should be included and excluded and why please.
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 11:56am
no prob.
 
I.) if we invoiced account before 12/1/2003 but never invoiced between 12/2/2003 - 12/1/2008 -- DO NOT SHOW DATA (meaning 1)
 
II.) if we invoiced account after 12/1/2008 do not include (meaning 1)
 
III.)  if we invoiced ONLY between 12/1/2003 - 12/1/2008 - show me those account Names (meaning 0)
 
A/C #1
Invoiced: 5/2009 - do not show A/C #1
 
A/C #2
Invoiced: 6/2004 - show
 
A/C #3
Invoiced: 2/2002 - do not show
 
A/C #4
Invoiced : 2/2002   AND 6/2004 - SHOW
 
I was using these formulas:
 
Date: if not ({INVOICE.DATE} in Date (2003, 12, 01) to Date (2008, 12, 01)) then 1
else 0
 
Date2: if not ({INVOICE.DATE} in Date (2003, 12, 01) to Date (2008, 12, 01)) then 2 else 3
 
Date3: if not ({INVOICE.DATE}  > date (12/1/2003) )then 4 else 5
 
Comparison: if {@Date} = 1 and( {@Date 2} = 2  or {@Date 3} = 5 )then 1 else 0
 
group #1- comparison
 
what am i doing wrong? 
IP IP Logged
lahorichick
Groupie
Groupie


Joined: 13 Aug 2009
Online Status: Offline
Posts: 54
Quote lahorichick Replybullet Posted: 03 Sep 2009 at 11:58am

i amost forgot--

 

Record Select

Sum of @Comparison = 0

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 12:15pm
You won't be able to do this that way. You started down the right path with your flags but you need to keep them seperate and then do an and stament looking at SUms of each. I have to run to a meeting but can check in later but the gyst is
date1= if ({INVOICE.DATE} in Date (2003, 12, 01) to Date (2008, 12, 01)) then 1 else 0
 
date2=if {INVOICE.DATE} < Date (2003, 12, 01) 1 else 0
date3=if {INVOICE.DATE} > Date (2008, 12, 01) 1 else 0
 
group select statement would be :
SUM(date1,group1)=0 and SUM(date1,group1>0) and SUM(date3,group1)=0
 


Edited by DBlank - 03 Sep 2009 at 7:42pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 7:50pm
OK now that I have a minute I think you can simplify this and that the above suggestion was wrong and probably did not return any results at all.
 
if ({INVOICE.DATE} in Date (2003, 12, 01) to Date (2008, 12, 01)) then 0 else 1
 
SUm on that at the group of invoice#
use the select expert on group selection
SUM(@date,group1)=0
 
This should exclude all records that had any activity before 12-1-03 or after 12-1-08.
That is what you need right?
IP IP Logged
<< Prev Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.