Use CFQUERPARAM and it'll work.  Or, if you must directly supply them
for some reason, pass them as a string formatted like this "yyyy-MM-dd
HH:mm:ss".

Depending on your version of MySQL, various numeric formats may or may
not work, but strings formatted as above will always work.  But just
use CFQUERYPARAM with type CF_SQL_TIMESTAMP and you won't have any
issues.

And keep in mind that leaving off the time part means midnight, it
doesn't mean any time that day.  That goes for every database you've
got datetime columns, unless you're casting.

cheers,
barneyb

On Mon, 13 Dec 2004 19:31:18 -0600, Nick Baker <[EMAIL PROTECTED]> wrote:
> I can get a search between the ID numbers to work, but not a search between
> dates.
> 
> I am working if the problem may be the way I have the dates formatted? The
> dates entered in the Database where entered using Now() and the field
> format was "DateTime"
> 
> Works
> 
> The following search for a range of ID numbers
> 
> Where DomainName = '#TargetURL#' AND ID BETWEEN 64112 AND 64579
> 
> Does not Work
> 
> The following search for a range of dates
> 
> <cfset StartDate = DateAdd("d", -1, DateConvert("local2utc", Now())) >
> <cfset EndDate = DateConvert("local2utc", Now())>
> 
> Where BizName = '#TargetBIZ#' AND TransactionDateTime BETWEEN #EndDate# AND
> #StartDate#
> 
> Thanks,
> 
> Nick
> 
> 
-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/blog/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187500
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to