|
Mysql - store TIME in a table |
Iniciado por Gianni Spano, 19,ene. 2006 08:07 - 8 respuestas |
| |
| | | |
|
| |
Publicado el 19,enero 2006 - 08:07 |
Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 12:45 |
Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 13:10 |
Hi Firetox Thanks for the tips!! Now, i will try it.. Gianni
Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 14:02 |
Hi Firetox I did try to apply your suggestion, but without any succesfull. Here is the error message i had from WD: Error in Local Procedure UpdatePluSalesFile process, line 37. HAdd function called. native MySQL access error. Error Number = 22
Error returned by database: Error Number = <1292>. Error Message: Incorrect time value: '0012-09-35 00:00:00' for column 'plu_sales_time' at row 1
********************************************** This is the automatic sql query (from WD): INSERT INTO plu_sales_file (plu_sales_key,plu_sales_id,plu_sales_date,plu_sales_time,plu_sales_receipt_no,plu_sales_direct_no,plu_sales_direct_campus,plu_sales_qty,plu_sales_val,plu_sales_stock_location) VALUES ( 1 , 1 , '2006-01-19' , '0012-09-35 00:00:00' , 18 , '' , 0 , 1 , 165 , 0 ) As you can see, despite i have declared "plu_sales_time" field as a Mysql "Time" type, it is trying to store a "DateTime" format.... I don't know why of this behaviour!! Can you (or someone) help me to resolve the issue? Thanks Gianni
Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 15:18 |
Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni Try yourfield..time = TimeSys() |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 15:19 |
what is the code in windev witch generate this SQL insert ?
Hi Firetox I did try to apply your suggestion, but without any succesfull. Here is the error message i had from WD: Error in Local Procedure UpdatePluSalesFile process, line 37. HAdd function called. native MySQL access error. Error Number = 22 Error returned by database: Error Number = <1292>. Error Message: Incorrect time value: '0012-09-35 00:00:00' for column 'plu_sales_time' at row 1 ********************************************** This is the automatic sql query (from WD): INSERT INTO plu_sales_file (plu_sales_key,plu_sales_id,plu_sales_date,plu_sales_time,plu_sales_receipt_no,plu_sales_direct_no,plu_sales_direct_campus,plu_sales_qty,plu_sales_val,plu_sales_stock_location) VALUES ( 1 , 1 , '2006-01-19' , '0012-09-35 00:00:00' , 18 , '' , 0 , 1 , 165 , 0 ) As you can see, despite i have declared "plu_sales_time" field as a Mysql "Time" type, it is trying to store a "DateTime" format.... I don't know why of this behaviour!! Can you (or someone) help me to resolve the issue? Thanks Gianni Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 19,enero 2006 - 20:47 |
Hi Firetox >what is the code in windev witch generate this SQL insert ? it is a simple moving value, like: .. .. plu_sales_file.plu_sales_time=Left(replace(TimeToString(TimeSys()),":",""),6)) .. .. Hadd (plu_sales_file) That's All A friend is suggesting to don't use the "date" e "time" field type for some compatible issues with other DBMS, then i will try to declare : - plu_sales_date as an integer of 8 - plu_sales_time as an integer of 6 I will let you know about this test. In the meantime if you have some tips & tricks, please, post them here.. Thanks Gianni
Hi Firetox I did try to apply your suggestion, but without any succesfull. Here is the error message i had from WD: Error in Local Procedure UpdatePluSalesFile process, line 37. HAdd function called. native MySQL access error. Error Number = 22 Error returned by database: Error Number = <1292>. Error Message: Incorrect time value: '0012-09-35 00:00:00' for column 'plu_sales_time' at row 1 ********************************************** This is the automatic sql query (from WD): INSERT INTO plu_sales_file (plu_sales_key,plu_sales_id,plu_sales_date,plu_sales_time,plu_sales_receipt_no,plu_sales_direct_no,plu_sales_direct_campus,plu_sales_qty,plu_sales_val,plu_sales_stock_location) VALUES ( 1 , 1 , '2006-01-19' , '0012-09-35 00:00:00' , 18 , '' , 0 , 1 , 165 , 0 ) As you can see, despite i have declared "plu_sales_time" field as a Mysql "Time" type, it is trying to store a "DateTime" format.... I don't know why of this behaviour!! Can you (or someone) help me to resolve the issue? Thanks Gianni Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 26,enero 2006 - 21:07 |
what is the code in windev witch generate this SQL insert ?
Hi Firetox I did try to apply your suggestion, but without any succesfull. Here is the error message i had from WD: Error in Local Procedure UpdatePluSalesFile process, line 37. HAdd function called. native MySQL access error. Error Number = 22 Error returned by database: Error Number = <1292>. Error Message: Incorrect time value: '0012-09-35 00:00:00' for column 'plu_sales_time' at row 1 ********************************************** This is the automatic sql query (from WD): INSERT INTO plu_sales_file (plu_sales_key,plu_sales_id,plu_sales_date,plu_sales_time,plu_sales_receipt_no,plu_sales_direct_no,plu_sales_direct_campus,plu_sales_qty,plu_sales_val,plu_sales_stock_location) VALUES ( 1 , 1 , '2006-01-19' , '0012-09-35 00:00:00' , 18 , '' , 0 , 1 , 165 , 0 ) As you can see, despite i have declared "plu_sales_time" field as a Mysql "Time" type, it is trying to store a "DateTime" format.... I don't know why of this behaviour!! Can you (or someone) help me to resolve the issue? Thanks Gianni Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | |
| |
Publicado el 26,enero 2006 - 22:53 |
Hi Firetox >what is the code in windev witch generate this SQL insert ? it is a simple moving value, like: .. .. plu_sales_file.plu_sales_time=Left(replace(TimeToString(TimeSys()),":",""),6)) .. .. Hadd (plu_sales_file) That's All A friend is suggesting to don't use the "date" e "time" field type for some compatible issues with other DBMS, then i will try to declare : - plu_sales_date as an integer of 8 - plu_sales_time as an integer of 6 I will let you know about this test. In the meantime if you have some tips & tricks, please, post them here.. Thanks Gianni
Hi Firetox I did try to apply your suggestion, but without any succesfull. Here is the error message i had from WD: Error in Local Procedure UpdatePluSalesFile process, line 37. HAdd function called. native MySQL access error. Error Number = 22 Error returned by database: Error Number = <1292>. Error Message: Incorrect time value: '0012-09-35 00:00:00' for column 'plu_sales_time' at row 1 ********************************************** This is the automatic sql query (from WD): INSERT INTO plu_sales_file (plu_sales_key,plu_sales_id,plu_sales_date,plu_sales_time,plu_sales_receipt_no,plu_sales_direct_no,plu_sales_direct_campus,plu_sales_qty,plu_sales_val,plu_sales_stock_location) VALUES ( 1 , 1 , '2006-01-19' , '0012-09-35 00:00:00' , 18 , '' , 0 , 1 , 165 , 0 ) As you can see, despite i have declared "plu_sales_time" field as a Mysql "Time" type, it is trying to store a "DateTime" format.... I don't know why of this behaviour!! Can you (or someone) help me to resolve the issue? Thanks Gianni Hello to All I'm trying, without succesfull, to store the time of an operation in a field defined, in a Mysql table, as "time" type. I don't know the correct mode to store a time value in this field. Can anyone help me to resolve this issue? Thanks in advance Gianni hello gianny if your column is "time" for update or insert in windev the format is a string with : "hhmmss" with the command : gauche(heuresys(),6) in french version this code is ok because the heuresys() return for example 120000 but if you have a time in this format : 12:00:00:00 you must change the code line in gauche(remplace(heureVersChaine(heuresys()),":",""),6)) or change ":" with "" for having the good format regards Firetox |
| |
| |
| | | |
|
| | | | |
| | |
|