Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Two Data parameter in crystal report Post Reply Post New Topic
Author Message
sunmat45
Newbie
Newbie


Joined: 29 Nov 2012
Online Status: Offline
Posts: 1
Quote sunmat45 Replybullet Topic: Two Data parameter in crystal report
     Posted: 29 Nov 2012 at 2:44am
i created one crystal report .... with two date parameter...... i used below mentioned query alone..
 
 
 AND ( TRUNC(O.ORDERDATE) BETWEEN  {?orderfromdate} AND {?ordertodate}
            OR
          TRUNC(OA.ADDDATE) BETWEEN  {?Fdate} AND {?Tdate}
        )
 
im going to pass any one date parameter.... but above query.... if im not entered any one date.... crystal report taking default date(sysdate)..... can u please give me good.. idea's... how can i pass two date parameter....
 
 
 
Thanks & Regards,
Prabu A
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Nov 2012 at 3:44am
If I understand you correctly, you want the users to be able to enter either one set of dates or the other, but not both.  Is that correct?
 
Here's how I would handle it:
 
1.  Set up one set of date parameters.
 
2.  Add an additional parameter that is something like "Filter Date" with the values "Order Date" and "Add Date".  Reorder the parameters to put it directly above the date parameters.
 
3.  Change the logic to something like this:
 
AND(
  ({?Filter Date} = 'Order Date' and Trunc(O.ORDERDATE) between {?startdate} and {?enddate})
OR
 ({?Filter Date} = 'Add Date' and Trunc(OA.ADDDATE) between {?startdate} and {?enddate})
)
 
This way you're not dealing with optional parameters and you force users to select only one set of dates.
-Dell
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