http://www.mysql.com/doc/en/Date_and_time_functions.html

They have a nice new web site, I see.  I like the new format.

mySQL has no DAY() function.  You can try using DayName() instead.  This
assumes AccountCreationDate is a valid mySQL date field.  And if you go
there it also makes your code platform-specific.  Again.

<soapbox>
This illustrates, IMHO, why you stay away from using anything that could
be platform-specific in your SQL (and most especially in your field
specs).  I've always treated the db as a file cabinet only.  Get files
from it.  Put files back; add new ones.  Nothing fancy.  Leave that to
whatever it is you use to massage the data.
</soapbox>

You will hear vehement and learned arguments to the contrary that state
you should write code, SQL and db-level field constraints that are
optimal to the platform you are currently using, and rewrite it to a new
optimum if you change platforms.  I'll say no more than that in the
hopes of avoiding a jihad :).

--Matt Robertson--
MSB Designs, Inc.
http://mysecretbase.com



-----Original Message-----
From: Rick Faircloth [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 18, 2002 7:41 PM
To: CF-Talk
Subject: How can I modify this query so mySQL will be happy?


This worked with MS Access, but I'm getting an error with this now...

<CFQUERY Name="GetClients" Datasource="#DSN#">

Select ClientID from clients C

where Day(AccountCreationDate) = #Form.Day#
   and Month(AccountCreationDate) = #Form.Month#
   and Year(AccountCreationDate) = #Form.Year#

</CFQUERY>

Here's the error:

[TCX][MyODBC]You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server version
for the right syntax to use near '(AccountCreationDate) = 18 and
Month(AccountCreationDa



The error occurred while processing an element with a general identifier
of
(CFQUERY),
occupying document position (34:218) to (34:263).

Thanks!

Rick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to