I have a database with a datetime field, how I can change the date to the current date time keeping?
thanks
I have a database with a datetime field, how I can change the date to the current date time keeping?
thanks
Use QTime.
Extract time from the system and update it in the database.
Heavy Metal Rules. For those about to rock, we salute you.
HIT THANKS IF I HELPED.
I have a table with a datetime field you can change all values ​​in the field of time keeping and changed the part of date.
The field looks like this:
2012-08-07T11: 38:00
You can change the 08/07/2012 holding T11: 38:00 intact.
Qt Code:
query.prepare("UPDATE HORAS SET DIAHORA = CONCAT(?, time(DIAHORA))"); query.exec();To copy to clipboard, switch view to plain text mode
How you do this will depend on the database date functions and the exact type of the "date time" column. Which database engine?
use QSQLITE
Qt Code:
db.setDatabaseName(Path + "/Eventos/evento.evt"); db.open(); query.exec("UPDATE HORAS SET HORA = DATE_ADD(HORA, INTERVAL 1 DAY) WHERE rowid > 0"); // errorTo copy to clipboard, switch view to plain text mode
hey you're writing the wrong SQL Statements. Set all the value of Date in the variables and update it here. How SQLite will know that you're using the date_add function.
Heavy Metal Rules. For those about to rock, we salute you.
HIT THANKS IF I HELPED.
Bookmarks