Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Birthday search ignoring the year Post Reply Post New Topic
Author Message
ukwd
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 1
Quote ukwd Replybullet Topic: Birthday search ignoring the year
    Posted: 31 Mar 2009 at 1:01am
I have a database where I capture the customers date of birth.
What I require is a formula to be able to put in a date range (say from date to date) and for Crystal to return any birthdays that fall in that date range Ignoring the year parts!

So if I search for 01/01/2008 to 01/03/2008 it will return ANYONE who has a birthday in January or February.

Any help would be great.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 31 Mar 2009 at 6:18am
Well, this seems challenging.  I am guessing that you are going straight to the tables, not via a stored proc, so this would be a filter on the records.  With that said, I would guess that your filter look something like:
If Month({table.birthdayfield}) >=Month({@parameterStart}) and Month({table.birthdayfield}) <= Month({@parameterEnd}) then
If Day({table.birthdayfield}) >=Day({@parameterStart}) and Day({table.birthdayfield}) <= Day({@parameterEnd}) then
true
else false
else false
 
 
This should do it. Hope it helps
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.