Parenthesis in queries.

From: Daniel Lorimer (thelorime..mail.com)
Date: Tue Jul 05 2005 - 16:02:05 EDT

  • Next message: Todd O'Bryan: "Re: DataObject states"

    I'm trying to build a SelectQuery with an Expression.

    What I want to do is make the expression something like:

    WHERE MONTH(birthDate) = '07'
    WHERE YEAR(birthDate) = '2005'

    When formatted correctly it would return based only on the month rather than
    the whole date.

    I have done this succesfully with a SQLTemplateQuery, but I want it to be
    more versatile and match my other queries.

    So, I have attempted to make this into an expression for a SelectQuery by
    the fromString method, but I get an ExpressionParser error and it won't
    parse the string into an expression.

    It says:

    . . . Encountered "(" . . . .
    Was expecting one of:
    <EOF>
    "or" ...
    "and" ...
    "not" ...
    (etc. . . . )

    Is there some way around this?
    Is there some way to make the ExpressionParser take a parenthesis?
    Or is there a way I can change it so it will?

    And actually that raises another question I have:
    If I change the parser so it will take a parenthesis, will I have other
    problems.

    Any help with this would be greatly appreciated.

    Thanks,
    Daniel Lorimer



    This archive was generated by hypermail 2.0.0 : Tue Jul 05 2005 - 16:02:06 EDT