Mike Raynham wrote:

I have tested it, and it returns the results I would expect. I think the confusion comes from the order in which the WHERE expression is produced. If I were to write the SQL myself, without DBIx, I'd probably

It's DBIx::Class. DBIx is a namespace with hundreds of modules in it,
it is not fair to the respective authors to default DBIx to DBIx::Class.
If you want to abbreviate DBIC is common.

swap around the column names and supplied dates, like this:

SELECT * FROM my_table WHERE
($start_date >= start_date AND $start_date <= end_date) OR
($end_date   >= start_date AND $end_date   <= end_date)

That way makes more sense to me, but I don't think I can write it like that using DBIx (unless I opt for creating SQL directly).

I don't see why not... ? Explain what do you perceive the holdup would
be.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to