none
I Need to filter binding source using two dates by this code. but it is getting error RRS feed

  • Question

  • reservationViewDataTableBindingSource.Filter = string.Format("(HD_RESRV_CHECKINDATE >= {0:yyyy-MM-dd} AND HD_RESRV_CHECKINDATE <= {1:yyyy-MM-dd}) OR (HD_RESRV_CHECKOUTDATE >= {0:yyyy-MM-dd} AND HD_RESRV_CHECKOUTDATE <= {1:yyyy-MM-dd})", fromdate,ToDate);
    Tuesday, May 5, 2015 6:18 AM

Answers

  • You need single quotes around the constants

    From : {0:yyyy-MM-dd}

    To : '{0:yyyy-MM-dd}'

    From : {1:yyyy-MM-dd}

    To : '{1:yyyy-MM-dd}'


    jdweng

    • Marked as answer by RAGU DEVA Tuesday, May 5, 2015 6:51 AM
    Tuesday, May 5, 2015 6:39 AM

All replies