Hello ,
I wana retreive value from database .so I wana execute this query.
SELECT * FROM Schedule WHERE StartDateTime <=now() and EndDateTime>=now();
for this I m using
Code:
QSqlQuery query; query.prepare("SELECT *FROM Schedules WHERE StartDateTime<=:date ORDER BY ScheduleNo ASC"); query.bindValue(":date",currentSystemStartDate); query.bindValue(":endTime",currentSystemEndTime); query.exec(); if(query.isActive()) { while(query.next()) { startTime=query.value(2).toString(); } }
But My problem is that it does not perform this query I mean to say it give all the value of table either it satisfy the condition or not ....................
So Please if any one can do something for me then I m very thankful for him.............