Mark,

DATEPART is a SQL function but it is also a ColdFusion function . I don't think it is a Reactor issues (based on the debugging info it doesn't look like it's even making to to Reactor). After looking at livedocs though I think I am trying to use DATEPART in way that it was not intended to be used. It can be used with cfquery but I think it is being interpreted as a SQL function rather than a CF function. I'm thinking the way SQL interpretes it is different from how CF interpretes it and that is where I'm running into a problem.

This is actually starting to make me dizzy! ;)

Thanks for the help!

Ray

On 6/9/06, Mark Mazelin < [EMAIL PROTECTED]> wrote:
I just realized the syntax you are using. DATEPART is a SQL function,
correct? I don't think you can pass actual SQL statements into the
Reactor query object to get a different format for an existing field for
comparison. You may just need to create a normal ColdFusion cfquery
statement to handle SQL statements like this.

Mark

Ray Buechler wrote:

> Mark,
>
> Should have thought of that although I still get an error:
>
> Variable YYYY is undefined.
>
> So I tried single quotes around timestamp and got the following error:
>
> Parameter validation error for function DATEPART.
> The value of the parameter 2, which is currently "timestamp", must be
> a class java.util.Date value.
>
> I'm assuming that CF and reactor are seeing that as a literal string
> again. If I put single or double quotes around YYYY I get the
> "Variable YYYY is undefined." error again.
>
> Anyone have any ideas?
>
> Thanks,
>
> Ray
>
>
> On 6/9/06, *Mark Mazelin* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>     Try removing the quotes around your function call otherwise
>     Reactor sees
>     the function call as a literal string:
>
>     <cfset reportQuery.getWhere().isEqual("ARCommunity", DATEPART(YYYY,
>     timestamp), "#attributes.reportYear#") />
>
>     Mark
>
>     Ray Buechler wrote:
>
>     >
>     > This line of code:
>     >
>     > <cfset reportQuery.getWhere().isEqual("ARCommunity", "DATEPART(YYYY,
>     > timestamp)", "#attributes.reportYear#") />
>     >
>     > Generates the following error:
>     >
>     > The field 'DATEPART(YYYY, timestamp)' does not exist for the
>     > 'arCommunity' object.
>     >
>     > If it is not obvious, I am trying to pull records from a
>     specific year
>     > from a datetime field.
>     >
>     > My questions are:
>     >
>     > A. Is there a mistake in my code?
>     >
>     > B. Am I trying to do something that Reator is not designed to do?
>     >
>     > C. Is this a bug in Reactor?
>     >
>     > Thanks!
>     >
>     > Ray
>     >
>     > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>     > -- -- -- --
>     > Reactor for ColdFusion Mailing List
>     > [email protected] <mailto:[email protected] >
>     > Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
>     > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>     -- --
>     > -- -- -- --
>
>
>
>     -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>     -- -- -- -- --
>     Reactor for ColdFusion Mailing List
>     [email protected] <mailto:[email protected]>
>     Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
>     -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>     -- -- -- -- --
>
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to