maveric
12th June 2008, 06:57
Hi friends i have a small problem, I have a sqlite db in which there is a time range say from 17:30:35 to 17:45:55 now i have used two Q3TimeEdit to select the starting and The Ending Time and to export the selected time range values to excel.
void testexport::on_pushButton_4_clicked()
{
QTime time1 = Q3TimeEdit->time();
QTime time2 = Q3TimeEdit_2->time();
time_range.clear();
QStringList time_fields;
QSqlQuery time_query_header("select * from Plotting_data1 where 1=0"); //don't actually select anything but get a reference to the record set
QSqlRecord time_header_count = time_query_header.record();
QSqlQuery range("SELECT * FROM Plotting_data1 where Time>= ''time1" and Time<="time2"); // I get an error i tried so many things but i don get the desired o/p
In .Net ("SELECT * FROM Plotting_data1 where Time>= ' '' +time1+ " ' and Time<= ' '' +time2+ " ' "); by doing this i got the values in between the Start time and end time to excel. What do i need to do for Qt
When i pass the time directly i get the values between the intervals which i have specified,But when i try to pass it from the Q3TimeEdit i don't get.
QSqlQuery range("SELECT * FROM Plotting_data1 where Time>= '17:30:35' and Time<='17:35:55'"); // How to pass the values i have given in the Q3TimeEdit i have used.
void testexport::on_pushButton_4_clicked()
{
QTime time1 = Q3TimeEdit->time();
QTime time2 = Q3TimeEdit_2->time();
time_range.clear();
QStringList time_fields;
QSqlQuery time_query_header("select * from Plotting_data1 where 1=0"); //don't actually select anything but get a reference to the record set
QSqlRecord time_header_count = time_query_header.record();
QSqlQuery range("SELECT * FROM Plotting_data1 where Time>= ''time1" and Time<="time2"); // I get an error i tried so many things but i don get the desired o/p
In .Net ("SELECT * FROM Plotting_data1 where Time>= ' '' +time1+ " ' and Time<= ' '' +time2+ " ' "); by doing this i got the values in between the Start time and end time to excel. What do i need to do for Qt
When i pass the time directly i get the values between the intervals which i have specified,But when i try to pass it from the Q3TimeEdit i don't get.
QSqlQuery range("SELECT * FROM Plotting_data1 where Time>= '17:30:35' and Time<='17:35:55'"); // How to pass the values i have given in the Q3TimeEdit i have used.