assuming years are irrelevant, the condition for determining if it's
after the start day is like this.

WHERE (sp_start_month < #month(now())#
  OR (sp_start_month = #month(now())# AND sp_start_day <= #day(now())#)
)

Determining if you're before the end date is equivalent, just
reversed.  If both parts are true, you're within the season.  If you
need to deal with seasons that cross a year boundary (like
basketball), then you'll wan the inverse comparison (before the start
and after the end).

cheers,
barneyb

On 11/8/06, Mike | NZSolutions Ltd <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I have the following table...
>
> Season_period
> -------------
> Sp_id (PK)
> Season_id (FK)
> Sp_start_day (INT)
> Sp_start_month (INT)
> Sp_end_day (INT)
> Sp_end_month (INT)
>
> What I wish to do is select the season_id using a particular date. I am
> really not sure how to compare an actual date against just a day/month
> value.
>
> I am going to loop through a series of dates, and wish to know the
> matching season_id for a particular date.
>
> Any ideas on how I should go about building this query would be greatly
> appeciated.
>
> mike
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259738
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to