It looks to me like Day is a variable but you are comparing the value of #Form.Earliest_Birthdate_Day# to the actual WORD "Day" instead of the value of a variable named Day.
Try this instead <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> ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -----Original Message----- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Saturday, November 25, 2006 1:16 PM To: CF-Talk Subject: RE: How do I get number of birthdays? Jim... (or anyone else)... Do you see anything wrong with this code (part of a larger query) that would cause the query not to return no results if the following formfields, Form.Earliest_Birthdate_Day and Form.Earliest_Birthdate_Month and Form.Latest_Birthdate_Day and Form.Latest_Birthdate_Month are *not* used in the form (in other words, they CFIF at the beginning of this part of the query should exclude this section from consideration in the query). Here's the code: <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> Thanks, Rick PS - This was working fine yesterday, then today it just started returning no results if the formfields "Earliest_Birthdate_Day", "Earliest_Birthdate_Month", "Latest_Birthdate_Day", and "Latest_Birthdate_Month" are not used. ??? -----Original Message----- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Friday, November 24, 2006 4:22 PM To: CF-Talk Subject: Re: How do I get number of birthdays? I think this will work...check the logic, though. WHERE ((Month(Client_Birth_Date) = #Form.Earliest_Birth_Month# AND Day(Client_Birth_Date) >= #Form.Earliest_Birth_Day#) OR Month(Client_Birth_Date) > #Form.Earliest_Birth_Month#) <cfif Form.Earliest_Birth_Month GT Form.Latest_Birth_Month> <!---This takes care of cases where the months go over a new year---> OR <cfelse> AND </cfif> ((Month(Client_Birth_Date) = #Form.Latest_Birth_Month# AND Day(Client_Birth_Date) <= #Form.Latest_Birth_Day#) OR Month(Client_Birth_Date) < #Form.Latest_Birth_Month#) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:261660 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

