Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Time Selection Issue Post Reply Post New Topic
Author Message
gunar
Newbie
Newbie


Joined: 04 Feb 2008
Location: United States
Online Status: Offline
Posts: 12
Quote gunar Replybullet Topic: Time Selection Issue
     Posted: 10 Apr 2008 at 8:12am
CryHello,

and thank you in advance for any help with this issue.
I need to write a report with shows items and sales history.
Each item should have six columns for each month. So six month of history.
I created six calculation fields with this formula:
Local DateVar d := CDate ({p21_sales_history_report_view.invoice_date});
If Month({p21_sales_history_report_view.invoice_date}) = Month(DataDate) - 4
Then
{p21_sales_history_report_view.qty_shipped}
Else
0

I changed the - 4 to - 5 -6 etc. Unfortunately for some reason it does not pull any information  beyond January. Probably because we are in April and if the formula says April(4) - 5 the return value is -1 which is not a valid month. How can I tell Crystal only to count until 1 and then start at 12 again so I can see history from December.

Thanks

Gunar
Crystal XI


Edited by gunar - 10 Apr 2008 at 10:53am
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 10 Apr 2008 at 11:22pm
you can check the value returned. if it is less than 0 then add 13 so that u can get the correct  for e.g
xx = april(4) - 5;
if xx < 0 then
 xx = xx+13 (-1+13)
so xx will be 12
 
i hope this might solve ur problem
Thanks
Savan
IP IP Logged
gunar
Newbie
Newbie


Joined: 04 Feb 2008
Location: United States
Online Status: Offline
Posts: 12
Quote gunar Replybullet Posted: 11 Apr 2008 at 9:29am
How do I put the check value function in my if clause posted above. Sorry I am a real beginner.

Thanks 
IP IP Logged
gunar
Newbie
Newbie


Joined: 04 Feb 2008
Location: United States
Online Status: Offline
Posts: 12
Quote gunar Replybullet Posted: 11 Apr 2008 at 9:45am
I think we also need to consider the jump back in a year. thanks
IP IP Logged
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