Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Need to Pull data Post Reply Post New Topic
Author Message
Lymo7
Newbie
Newbie


Joined: 11 Aug 2021
Online Status: Offline
Posts: 2
Quote Lymo7 Replybullet Topic: Need to Pull data
    Posted: 12 Aug 2021 at 10:25pm
Hi,

I have a report that needs to be altered so that each month it is run it pulls in data based on the Policy Start Date which is in the same month. For Example, if I run today (13/08/2021) it's pulls all polices which have a start date in August.

I have a report which does something similar but is based on the policy renewal date and even though this could work if the policy doesn't change their renewal date, I'd rather it was based on the Policy Start Date. For this report it uses the Month function and the line in the Select is: {@Renewal Month} = Month (CurrentDate). The Renewal Month formula has connecting formulae. Below is the Renewal Month formula and the connecting formulae.

Renewal Month:

(DatePart("m", {@Contract end for Feb}))

Contract end for Feb:

if
DatePart ("d",{Coverage_Group_View.Policy_End_Date} ) = 28
and
DatePart ("m",{Coverage_Group_View.Policy_End_Date} ) = 02
then
Date(year({Coverage_Group_View.Policy_End_Date}),03 ,01) else
{@Actual Renewal Date}

Actual Renewal Date:

{Coverage_Group_View.Policy_End_Date} + 1

Do I need to follow the same as above for Policy Start Date?

I tried the below line in my new report but it's producing an error saying it's looking for a date.

{@Policy Start Date} = Month (CurrentDate)

Can someone please help me here?

Thanks :-)






IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4336
Quote lockwelle Replybullet Posted: 17 Aug 2021 at 7:29am
you would probably want month and year...

Month({@Policy Start Date}) = Month(CurrentDate)
AND
Year({@Policy Start Date}) = Year(CurrentDate)

though, don't you really want something like:
Month({table.PolicyStartDate}) = Month(CurrentDate)

Isn't the value in the table what you want to 'filter' on?

HTH
IP IP Logged
Lymo7
Newbie
Newbie


Joined: 11 Aug 2021
Online Status: Offline
Posts: 2
Quote Lymo7 Replybullet Posted: 17 Aug 2021 at 10:10pm
Thanks for your reply.

I found the issue I had was I entered the below without the Month function preceding {@Policy Start Date}.

{@Policy Start Date} = Month (CurrentDate)

i can't filter as the month will change every month.

I'm interested on your point including year too.

So would this return me any policies that has a start date in August 2021?

Thanks

Lymo
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4336
Quote lockwelle Replybullet Posted: 18 Aug 2021 at 1:27pm
What I don't know, is would it return you any policies with a start date in August 2020...or next year will it return the August 2021 data as well as the August 2022 data.

That is why I included the year, to filter out past data being returned...unless that is the desired outcome.

HTH
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.016 seconds.