First, use CFQUERYPARAM with CF_SQL_VARCHAR as the type. There are
various security/performance reasons, but it will also prevent MySQL
from doing an implict conversion to a date. I don't know if it's
happening, but it might be. Also consider that you're doing string
comparisons, not date comparisons, so things might not be quite as
you'd expect.
cheers,
barneyb
On 11/4/06, Cornel Ivanescu <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> I am running into a problem that I have tried to solve for 3 hours now with
> no avail...I have the following statements and query:
>
> <cfset startdate=#DateFormat(rsGetCustOrders.order_Date,'yyyy-mm-dd')#>
> <cfset
> enddate=#DateFormat(DateAdd("d",90,rsGetCustOrders.order_Date),'yyyy-mm-dd')#>
>
> <cfquery name="Recordset1" datasource="#request.dsn#">
> SELECT * FROM tbl_picks
> Where LEFT(tbl_picks.Pick_SKU,4) != "0000" and tbl_picks.Pick_SKU != "FREE"
> and Left(tblpicks.Pick_SKU,10) between "#startdate#" and "#enddate#"
> </cfquery>
>
> The query works without the last where clause "and Left(tblpicks.Pick_SKU,10)
> between "#startdate#" and "#enddate#"; in the Pick_SKU the first 10 char are
> the DATE 2006-11-03
>
> Thanks,
> Cornel
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:259170
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4