before you hit the db, try and create a date from the date parts. i.e. <cfset dateOfBirth = createDate(year, month, day)> you can them compare that to your dates, if they are stored as a date, you might need to convert it to get rid of the time... blah blah
I actually wanted to see some code to see how you called datePart(). Once again, I do not know if MySQL has this function but I believe it is a standard function in SQL. -----Original Message----- From: Andrew Dickinson [mailto:[EMAIL PROTECTED] Sent: Thursday, 11 December 2003 1:31 PM To: CFAussie Mailing List Subject: [cfaussie] Re: Slight OT : MySQL WHERE weirdness > did you try the doco's?? Yes (by websearches at least), and get conflicting info. But most of them list Day,Month,Year as valid functions. > Code sample? <cfquery name="GetDOBs" datasource="mydata"> SELECT CustID, First, Other, Sur, Bx_DOB FROM YESCustomer WHERE Year(Bx_DOB) < #Year(Q_Date)# AND Day(Bx_DOB) = #X# AND Month(Bx_DOB) = #Month(Q_Date)# ORDER BY Year(Bx_DOB) </cfquery> This one is a birthday finder. That is, input the day of the month and find customers whose birthdays are on that day. The code then loops through the days of a month, in order to display a list of customers for each birthday, and enable links from each particular birthday. This is mainly why the date is being split up into Day/Month/Year. > -----Original Message----- > From: Andrew Dickinson [mailto:[EMAIL PROTECTED] > Sent: Thursday, 11 December 2003 1:21 PM > To: CFAussie Mailing List > Subject: [cfaussie] Re: Slight OT : MySQL WHERE weirdness > > > Sorry guys, I've just tried datepart as well, and get the same error = > (i.e. > invalid mysql syntax). > > > I am not sure that MySQL supports the Year, Month, Day functions. I = > think > > you have to use something like DatePart. > >=20 > > CAVEAT: this is totally from memory and I didn't check the manuals. > >=20 > >=20 > > Gary Menzel > > Web Development Manager > > IT Operations Brisbane -+- ABN AMRO Morgans Limited > > Level 29, 123 Eagle Street BRISBANE QLD 4000 > > PH: 07 333 44 828 FX: 07 3834 0828 > >=20 > >=20 > >=20 > >=20 > > If this communication is not intended for you and you are not an = > authorised =3D > > recipient of this email you are prohibited by law from dealing with or = > relyi=3D > > ng on the email or any file attachments. This prohibition includes = > reading, =3D > > printing, copying, re-transmitting, disseminating, storing or in any = > other w=3D > > ay dealing or acting in reliance on the information. If you have = > received t=3D > > his email in error, we request you contact ABN AMRO Morgans Limited = > immediat=3D > > ely by returning the email to [EMAIL PROTECTED] and destroy = > the ori=3D > > ginal. We will refund any reasonable costs associated with notifying = > ABN AMR=3D > > O Morgans. This email is confidential and may contain privileged = > client info=3D > > rmation. ABN AMRO Morgans has taken reasonable steps to ensure the = > accuracy =3D > > and integrity of all its communications, including electronic = > communications=3D > > , but accepts no liability for materials transmitted. Materials may = > also be =3D > > transmitted without the knowledge of ABN AMRO Morgans. ABN AMRO = > Morgans Lim=3D > > ited its directors and employees do not accept liability for the = > results of =3D > > any actions taken or not on the basis of the information in this = > report. ABN=3D > > AMRO Morgans Limited and its associates hold or may hold securities = > in the =3D > > companies/trusts mentioned herein. Any recommendation is made on the = > basis =3D > > of our research of the investment and may not suit the specific = > requirements=3D > > of clients. Assessments of suitability to an individual=3D3Fs = > portfolio can =3D > > only be made after an examination of the particular client=3D3Fs = > investments, =3D > > financial circumstances and requirements. > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to = > [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
