Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: paremeters for month and year Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Aug 2012 at 7:21am

I assume you will always need the year param.

If you do not use it and a user selects say quarter 1, it would select all quarter 1's for all the years in your original data set.
You have the same issue with month param and that is why I did not recommend using a 0 in the year param.
Your original post wanted either a full selected year or a full month of 1 year so I assume the quarter is also for only one year.
 
Maybe you are limiting your data set to only one year in soem other way?
 
Under the condition that you have multiple years of data to deal with your select statment should be something like:
 
({?month}=0 or {?month}=month({table.datefield}))
and
({?Quarter}=0 or {?quarter}=datepart('q',{table.datefield}))
and
{?Year}=year({table.datefield})
 
If a user select both a month and a quarter and the month is in the selected qurter only the month records will be shown.
 IF they pick month that is outside the q then no records would be returned.
 
your display string would be
 
 
'Working Hours In ' +
(
if {?month}= 0 then and {?quarter}=0 then 'year' else
if {?Month} <> 0 then monthname({?month}) else
if {?Quarter} <> 0 then 'Quarter ' + totext({?Quarter},0,'') + ' of '
) + ' ' + totext({?Year},0,'')
 
 
 


Edited by DBlank - 08 Aug 2012 at 7:23am
IP IP Logged
jnnpvan
Newbie
Newbie


Joined: 03 Aug 2012
Location: Canada
Online Status: Offline
Posts: 19
Quote jnnpvan Replybullet Posted: 08 Aug 2012 at 8:57am
Yeah, I got perfect output.
Thank you very much.
 
IP IP Logged
<< Prev Page  of 2
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.047 seconds.