Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: pasing date values to multiple parameters Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Topic: pasing date values to multiple parameters
     Posted: 09 Aug 2010 at 3:45pm

Hello

 
I have a situation where I want to set a parameter for a work_date range.  This is OK however I also need to use the same dates specified in the work_date start and end dates for:

1. ‘Employee_Team_Start_Date’ and ‘Employee_Team_End_Date’ AND

2. ‘Employee_History_Start_Date’ and ‘Employee_History_End_Date’

 

The problem is that I do not want the user to enter the date values in 3 times when the prompt comes up.  I tried to set it up through the select expert by creating 2 parameters, i.e. Start Date and End Date

And using the following logic but it does not work:

 

 

Work_date = {command.work_date} in {?startdate} to {?enddate}

 

Employee_Team_Start_Date’ less than or equal to {?startdate}

Employee_Team_End_Date’ is greater than or equal to {?end date}

Employee_History_Start_Date’ less than or equal to {?startdate}

Employee_History_End_Date’ is greater than or equal to {?end date}

 

 

I would really appreciate any assistance possible

 

Regards,
Despina

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Aug 2010 at 3:52am
is this all in one report or are you using sub reports?
 
IP IP Logged
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Posted: 11 Aug 2010 at 4:09pm
Hello
 
This is all in one report however once I have the first part working i will also be creating a sub report which will need to have the same values passed also
 
Regards,
Despina
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Aug 2010 at 4:11am

need a little more clarity here.

1.you want user to enter a date range, correct?
do you want to see employees that were active at any time during this range or only during the entire range?
do youwant to see employees active in both the team and individual or either team or individual?
IP IP Logged
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Posted: 12 Aug 2010 at 12:24pm

Hello,

Yes I would like a user to enter a date range and a team id in a parameter pop up.

 

In the system that I am querying we have floating employee numbers.  These numbers are used by agency staff that are hired on a casual basis.  In order to view the correct timesheet details for the employee ID I am querying I need to ensure the date range is set for the same period in 3 tables being:

 

1. Employee history table (gives me the name of employee assigned to floating badge number within the specified date range)

2. Employee team table (aligns the badge number to a team number) and

 

3. Work Details table (the period the employee has worked)

 

Tables 2 and 3 will be where my parameters are pointing to.

 

The employee may/may not work all days within the fortnight. For example the employee may only work 6 days out of 14.  The query would only return payment details for the 6 days actually worked.

 

I have written my script in SQL and get the correct results when I run it using DBVizulizer - the problem is that my script specifies the same date range for the three tables mentioned above, i.e:

 

and EMPHIST_START_DATE <= to_date('20090105','yyyymmdd') and  EMPHIST_END_DATE >=  to_date('20090106','yyyymmdd')

and et.EMPT_START_DATE <= to_date('20090105','yyyymmdd') and et.EMPT_END_DATE >= to_date('20090106','yyyymmdd')


and ws.WRKS_WORK_DATE >= to_date('20090105','yyyymmdd') and WS.WRKS_WORK_DATE  <= to_date('20090106','yyyymmdd')

 

When moving the script to crystal reports I only want to prompt the user for the date range once and not 3 times as the date range for each of the 3 tables will always be the same

 

Hope this helps you to understand it a little better

 

Regards,
Despina

 

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Aug 2010 at 9:13am
are you creating the parameters at the source and then passing them through crystal or are these strictly crystal params?
IF theat crystal params you can just create  2 date params, join your tables as necessary and use the params in each part of your select statment...

EMPHIST_START_DATE <= {?startdate} and  EMPHIST_END_DATE >=  {?enddate}

and et.EMPT_START_DATE <= {?startdate} and et.EMPT_END_DATE >= {?enddate}
and ws.WRKS_WORK_DATE >= {?startdate} and WS.WRKS_WORK_DATE  <= {?enddate}

 



Edited by DBlank - 13 Aug 2010 at 9:14am
IP IP Logged
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Posted: 18 Aug 2010 at 1:08pm
Hello,
 
Thankyou so much!!!  I finally got the paramters working during run time:
 
I had to adjust the paramter to also include the defaul format value i.e.:
({?WS Start Date},'yyyymmdd') and it works perfectly now
 
and et.EMPT_START_DATE <= to_date({?WS Start Date},'yyyymmdd') and et.EMPT_END_DATE >= to_date({?WS End Date},'yyyymmdd')
and EMPHIST_START_DATE <= to_date({?WS Start Date},'yyyymmdd')and  EMPHIST_END_DATE >=  to_date({?WS End Date},'yyyymmdd')
and ws.WRKS_WORK_DATE >= to_date({?WS Start Date},'yyyymmdd') and WS.WRKS_WORK_DATE  <= to_date({?WS End Date},'yyyymmdd')
 
Regards,
Despina
IP IP Logged
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Posted: 18 Aug 2010 at 1:25pm
Hi,
 
I am trying to create a team paramter now which is a defined as a varchar in the database.
 
I have created a string crystal paramter and inserted into my SQL as follows:
and wbt.WBT_NAME in {?Team}
 
however I get a error message saying:
 
Failed to retrieve data from the db
Details:ADO Error Code:0x
Description: ORA-00936:missing expression
Native Error: database vendor code:936
 
Regards,
Despina
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Aug 2010 at 3:45am
 wbt.WBT_NAME = {?Team}
IP IP Logged
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Posted: 22 Aug 2010 at 12:49pm
Hi,
 
For some reason I kept getting an invalid number error so I put the value in ' ' and it worked i.e.
and wbt.WBT_NAME  in ('{?team}')
(team can be an alphanumeric value)
 
Is there a way to allow a user to enter more than 1 value during run time?  I do not want a between value?
 
Regards,
Despina
IP IP Logged
Page  of 2 Next >>
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