Home » U++ Library support » U++ SQL » error in example/SQLApp [FIXED]
Re: error in example/SQLApp [message #13964 is a reply to message #13963] |
Mon, 04 February 2008 00:22   |
|
.... continued previous message
I think.
A code should look something like this.
void SQLApp::Query()
{
SqlBool where;
SqlSet borrowed = Select(BOOK_ID).From(BORROW_RECORD).Where(IsNull(RETURNED));
int q_date_from = ~query.date_from - Date(1970, 1, 1); // <== NEW
int q_date_to = ~query.date_to - Date(1970, 1, 1); // <== NEW
if(query.status == 1)
where = ID != borrowed;
if(query.status == 2)
where = ID == borrowed;
SqlBool bdate;
if(!IsNull(query.borrowed_from))
// bdate = BORROWED >= ~query.borrowed_from;
bdate = BORROWED >= q_borrowed_from; // <== NEW
if(!IsNull(query.borrowed_to))
// bdate = BORROWED <= ~query.borrowed_to;
bdate = BORROWED <= q_borrowed_to; // <== NEW
if(!bdate.IsEmpty())
where = where && ID == Select(BOOK_ID).From(BORROW_RECORD).Where(bdate);
book.Query(where);
}
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Goto Forum:
Current Time: Fri Jul 18 10:59:46 CEST 2025
Total time taken to generate the page: 0.03919 seconds
|