Claude,
You need to compare the database field with an ODBC DateTime object.
Remember in Auatrslia that you have to take local date format into account.
So:
1. grab the target date from a form as a string
2. convert it to Locale format using LSDateFormat - don't forget to
setLocale=("English (Australian)")
3. convert to an ODBC datetime object using CreateODBCDateTime
4. use the ODBC datetime object in your SQL: WHERE ArticleDate =
#targetDateAsODBCDateTimeObject#
Good luck,
Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork
-----Original Message-----
From: AustralianAccommodation.com Pty. Ltd.
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 30, 2000 3:01 PM
To: [EMAIL PROTECTED]
Subject: Searching records with specific date values
I has an articles database and i am wanting to be able to search the
database for articles that were published on a specified date. The dates are
selected from a drop down list populated from the dates of each record in
the articles table.
The following code is taken from my action page however when ever i pass a
date from the search form to the action page i receive an error message
saying
" Error Diagnostic Information
ODBC Error Code = 22012 (Division by zero)
[Microsoft][ODBC Microsoft Access Driver]Division by zero (null)
Data Source = "citicentre"
SQL = "SELECT * FROM articles WHERE articleid not like 0 AND ArticleDate
like 05/07/00"
"
The action page code is as follws the dates in the search form page appear
using the format of #DateFormat(ArticleDate, 'DD/MM/YY')# may be this is
something to do with the problem
your assistance would be appreciated
<CFQUERY DATASOURCE="citicentre" NAME="articles">
SELECT *
FROM articles
WHERE articleid not like 0
<cfif articletitle is not "">
AND articletitle like '#form.articletitle#%'
</cfif>
<cfif articledate gt 0>
AND ArticleDate like #DateFormat(ArticleDate, 'DD/MM/YY')#
</cfif>
Kind Regards
Claude Raiola (Director)
AustralianAccommodation.com Pty. Ltd.
Website: www.AustralianAccommodation.com
Email: [EMAIL PROTECTED]
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.