Escaped mysql function in join condition

Escaped mysql function in join condition

BofferleBofferle Posts: 1Questions: 1Answers: 0

Hi there!

I'm trying to use a BETWEEN condition when joining a table using
->leftJoin( 'ageclass', ' YEAR(user.birthdate) BETWEEN ageclass.startYear AND ageclass.endYear ', '', '')
but my YEAR-functions ends up in
ON `YEAR`(user.birthdate) BETWEEN ageclass.startYear AND ageclass.endYear

Any ideas how I can avoid the escaping of the YEAR-function or any better solution for my BETWEEN condition?

Thank you!

Answers

  • allanallan Posts: 63,205Questions: 1Answers: 10,415 Site admin

    I'm sorry - there is currently no way to use a BETWEEN operation as a selector for the left join. The only way to do this is with a VIEW.

    The lack of ability to do complex joins is something we are aware of and will be looking at resolving.

    Regards,
    Allan

This discussion has been closed.