Rick Faircloth wrote: > > <CFIF Form.Earliest_Birthdate_Day is not "Day" > and Form.Earliest_Birthdate_Month is not "Month" > and Form.Latest_Birthdate_Day is not "Day" > and Form.Latest_Birthdate_Month is not "Month"> > > and (((Month(Client_Birthdate) = #Form.Earliest_Birthdate_Month# > and Day(Client_Birthdate) >= #Form.Earliest_Birthdate_Day#) > or Month(Client_Birthdate) > #Form.Earliest_Birthdate_Month#) > > <CFIF Form.Earliest_Birthdate_Month GT > Form.Latest_Birthdate_Month> > <!---This takes care of cases where the months go over a new > year---> > or > <CFELSE> > and > </CFIF> > > ((Month(Client_Birthdate) = #Form.Latest_Birthdate_Month# > and Day(Client_Birthdate) <= #Form.Latest_Birthdate_Day#) > or Month(Client_Birthdate) < #Form.Latest_Birthdate_Month#)) > > </CFIF> > > > Order by C.Client_Last_Name > > </CFQUERY>
Rick, See above...I added in parentheses to group the birthdate stuff, so that it is evaluated together. The way you had it before you could have possibly had all (or any) of the parameters evaluate to false, but if the earliest month was greater than the latest month, that OR would have made it so records would be returned if that last part about the latest birthdate was true. Hopefully that makes sense...it's kind of hard to explain without pointing at it. Anyway, that is the only thing I can think of that would cause what you are describing. -jim ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:261675 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

