Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: range of date Post Reply Post New Topic
Author Message
kiddo
Newbie
Newbie


Joined: 11 Feb 2010
Location: Australia
Online Status: Offline
Posts: 1
Quote kiddo Replybullet Topic: range of date
     Posted: 11 Feb 2010 at 5:00am
hi,

i would like to ask about return data with  date as discrete parameter.

i used view for my CR n the parameter {?date} based on invoice_date,
for example i take '1/1/2010' in my parameter then the procedure have to shown sales from '31/12/2009' until '1/12/2010'

formula1 : max ==>   {?date}-1
                 min ==> {?date}-30

then procedure to take sales is
if invoice_date in {@min} to {@max} then {detil.sales}

but i have no idea why it wasnt work.

may u help me?
ewww
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Feb 2010 at 6:16am
I'm not sure that just subtracting 1 will give you the day before, but if it does, they your date range is 12/31/09 to 12/2/09 and NOTHING is in that range.
 
use DATEADD() and what I thing you want is:
local datevar minDate := DateAdd("d"1,{?date})  //12/31/09;
local datevar maxDate:=DateAdd("m", -1, {?date}); //12/1/09
 
maxDate := DateAdd("yyyy",1, maxDate);  // 12/1/10
 
HTH
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