Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: date not sorting records Post Reply Post New Topic
Author Message
James Everson
Newbie
Newbie
Avatar

Joined: 17 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 1
Quote James Everson Replybullet Topic: date not sorting records
     Posted: 17 Nov 2009 at 8:20am
Hi List,
 
I've only just had my training today so I aologise for the dumb question.
 
I want to be able to sort on a date range for files between say 01/10/2009 and 31/10/2009.
 
The code that I am using is
 
{OPMGR.CLOSEDDATE} <={?End Date};
{OPMGR.STARTDATE} >= {?Start Date};
{OPMGR.USERID} = {?User};
{OPMGR.RECTYPE} = "p"
 
"P" is equal to Projects (this is a goldmine field)
 
Both?StartDate and ?End Date are parameter fields
 
when I run the report I get all of the records, can someone please help.
 
Many Thanks in andvance.
IP IP Logged
lorimack
Groupie
Groupie


Joined: 03 Nov 2009
Online Status: Offline
Posts: 48
Quote lorimack Replybullet Posted: 17 Nov 2009 at 10:43am
Hi,
 
Could you not try to go to the select record expert and create a new selection based on your dates?
 
select the field you are basing your choice on then select the "in between" choice and enter those dates.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Nov 2009 at 11:04am

The only thing I would disagree with in lorimack's statment is that you cannot use "is between" because you have different begin and end date fields in your db.

In your select expert I think you want all AND statements for your conditions:
{OPMGR.CLOSEDDATE} <={?End Date} and
{OPMGR.STARTDATE} >= {?Start Date} and
{OPMGR.USERID} = {?User} and
{OPMGR.RECTYPE} = "p"
 


Edited by DBlank - 17 Nov 2009 at 11:05am
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