Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: 2 different date ranges Post Reply Post New Topic
Author Message
bigdummy76
Newbie
Newbie


Joined: 17 Jun 2011
Location: United States
Online Status: Offline
Posts: 15
Quote bigdummy76 Replybullet Topic: 2 different date ranges
    Posted: 26 Aug 2011 at 3:20am
I have a report with parameters for 2 different date ranges. One of the ranges is not optional the other range is optional.
 
Admit Date in the range 00/00/0000 to 00/00/0000 is not optional
Target discharge date in the range 00/00/0000 to 00/00/0000  is optional, not everyone populates this field.
 
I've tried the not hasvalue function for the target discharge date but cant seem to get it to work.
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 Aug 2011 at 4:14am
what cant seem to get it to work?
the option to use one or the other parameters?
in the record selection, can you use each one seperatley?
can you put your record selection formula here, it will help to help you.
sharona
IP IP Logged
bigdummy76
Newbie
Newbie


Joined: 17 Jun 2011
Location: United States
Online Status: Offline
Posts: 15
Quote bigdummy76 Replybullet Posted: 26 Aug 2011 at 5:06am
I have a from target discharge date parameter and a through target discharge date parameter. Here is a record selection formula that works using only the  the from target discharge date. What I need to do is create a range using from target discharge date - through target discharge date.
 
if hasvalue ({?From Target Discharge Date}) then
{event_admission.target_discharge_date} = {?From Target Discharge Date} else
{event_admission.target_discharge_date} = DateValue ({event_admission.target_discharge_date}) and
{?Facility} = {event_admission.facility_name} and
{event_admission.admission_date} in {?Date From} to {?Date Through}
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 Aug 2011 at 6:20am

if you need a range parameter, is your parameter set up for range values?

if hasvalue ({?From Target Discharge Date}) then
{event_admission.target_discharge_date} >= {?From Target Discharge Date} and {event_admission.target_discharge_date}<= {?Date Through}
sharona
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Aug 2011 at 11:56am


(not(hasvalue(?discharge begin)) or
(hasvalue(?discharge begin) and event_admission.target_discharge_date in ?discharge begin to ?discharge end))
And ?facility = event_admission.facility_name and event_admission.admission_date in ?date from to ?Date Through

Edited by DBlank - 26 Aug 2011 at 11:56am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.020 seconds.