HQL Date comparisons

7 paparan
Langkau ke mesej pertama yang belum dibaca

Steve Onnis

belum dibaca,
4 Sep 2012, 3:56:28 PG4/09/12
kepada cfau...@googlegroups.com
Can anyone help me out with this.  Doesnt matter what i try it wont work :(

Trying to return items within a date range or after a certain date but the end date in the db can be empty or null. any ideas on where i am going wrong?


LOCAL.r =  ORMExecuteQuery("
    SELECT     af.title, af.caption, af.asset.assetid
    FROM     Feature as af join af.asset as a
    WHERE    a.assettype.assettypeid = 1
    AND     a.orientation = 'Landscape'
    AND     (
            af.startdate >= :dateValStart
            AND
            (af.enddate <= :dateValEnd OR af.enddate IS NULL)
            )
    ",
    {dateValStart=createODBCDate(NOW()), dateValEnd=createODBCDate(NOW())}, false, {maxResults=ARGUMENTS.records});

Steve Onnis

belum dibaca,
5 Sep 2012, 7:30:33 PTG5/09/12
kepada cfau...@googlegroups.com
anyone?
Balas kepada semua
Balas kepada pengarang
Kirim Semula
0 mesej baharu