Errr... umm... no, that's the wrong way around ...

In your query what you're doing is you're asking MS Access

is #CFvariable1# = #cfvariable2# ?

which is the same as using literal values like:

is 1 = 2?

In order to get the result you want, you're going to need to remove the #
symbols from the date you want to retreive from the db and use an MS Access
function to return the month, so your query should read something like:

select id,title,sdescrip, bdate
from courses where bdate IS NOT NULL
and month(bdate) = #month(searchdate)#
order by bdate, title

Offhand I don't remember if Access accepts <> NULL  or = NULL but SQL-92
standard db's usually require IS and IS NOT for the evaluation of nulls.

hth


s. isaac dealey                954-776-0046

new epoch                      http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource     http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816

> you may need to put a # around the date if it is a date
> field in access..
> ex..
>  #dateformat(bdate, m)# = ###Dateformat(searchdate,
>  "m")###

> -- Sam

> -----Original Message-----
> From: Rebecca Joy Sherman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 11:54 AM
> To: CF-Talk
> Subject: Access date issue


> Trying to query a database  to get all the records where
> the bdate is in
> the same month and year.  This example is only the month.
> But it is not
> working what am I missing.
> I am using CF5 and Access


> <CFQUERY datasource="#application.db#" name="howmany">
> select id,title,sdescrip, bdate
> from courses
> where bdate <> NULL
> and #dateformat(bdate, m)# = #Dateformat(searchdate, "m")#
> order by bdate,title
> </CFQUERY>


> Joy ;-*



> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> 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.

>                               Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
>                               ubscribe.cfm?user=633.558.4


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to