Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date ranges Post Reply Post New Topic
Author Message
Taz66
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote Taz66 Replybullet Topic: Date ranges
     Posted: 27 Oct 2008 at 5:01am
using crystal how do i create a parameter for using date ranges

eg if i want all info from 01/03/2005 - 01/07/2006

can this be created so it will prompt me to type a date range in or if really clever pick from a calender


Taz
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 27 Oct 2008 at 6:03am

Hi,

Create two parameters with Data type as Date ,Once created it will  pop-up with calendar control.....
 
Check your table Date field/s with these parameters.
 
Cheers
Rahul
 
IP IP Logged
Taz66
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote Taz66 Replybullet Posted: 28 Oct 2008 at 6:19am
i have done that and used select expert to link it

IF {?Brand fitments}="ALL"
THEN {vfmProductBrands.Description}LIKE"*"
ELSE {vfmProductBrands.Description}={?Brand fitments} and
{vfmAuthorisationDetails.InsertDate} in {?Start Date } to {?End Date }

the latter is the formula thats applicable, it doesnt seem to be working as the data it returns is incorrect have i missed something
Taz
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 28 Oct 2008 at 12:36pm
I use a lot of date ranges in my reports.  Instead of {vfmAuthorisationDetails.InsertDate} in {?Start Date } to {?End Date }
I typically say
({vfmAuthorisationDetails.InsertDate} >= {?Start Date } and
{vfmAuthorisationDetails.InsertDate} <= {?End Date })
I have never used the in xxx to xxx format.   If you figure it out using your method, would you let us know.  That seems easier than my method.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 29 Oct 2008 at 1:54am

I'm wondering if the other conditions might be messing up the final result? I've had multiple conditions and I think that the last one is failing, but then realize that a null value messed up one of the original tests. So when I see multiple conditions like this, I like to break things apart and test each condition by itself to validate it. If each one on its own gives the correct data, then I know that the problem lies with how I built the combination of them all.

So I would create the formula just using the date part and see how that goes and get it working. Then add the other conditions individually and test it each step of the way.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Taz66
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote Taz66 Replybullet Posted: 29 Oct 2008 at 8:18am
it doesnt work

if i leave off the end date then its ok

IF {?Brand fitments}="ALL"
THEN {vfmProductBrands.Description}LIKE"*"
ELSE {vfmProductBrands.Description}={?Brand fitments} and
{vfmAuthorisationDetails.InsertDate} >{?Start Date }

but when i add the end date it doesnt work
Taz
IP IP Logged
Taz66
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote Taz66 Replybullet Posted: 29 Oct 2008 at 8:23am
sorry if i use the date formula on its own it works but when i add the other parameters then it doesnt
Taz
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