I'm having a problem with date formats.
In V10 I created a grid to do what I used to do in a dialog in V9. I have a grid where I enter some information, a date and a quantity. I save that into a dummy table, get the record Id into a session variable and then go to an Xbasic only page where I create the quantity number of records. The grid saves the date in MySQL properly as 2009-10-09000:00:00
I'm using a MySQL backend, so I find my record using a select statement, and read the results into variables:
Then, I insert the records in a loop into the next table:
The insert, however, is trying to insert the date in Alpha format as "10-09-2009 00:00:00 am" which, of course, causes an error.
I think this "helpful" format change is coming out of the evaluate_string() function.
Any thoughts on how I can get around this problem?
Pat
In V10 I created a grid to do what I used to do in a dialog in V9. I have a grid where I enter some information, a date and a quantity. I save that into a dummy table, get the record Id into a session variable and then go to an Xbasic only page where I create the quantity number of records. The grid saves the date in MySQL properly as 2009-10-09000:00:00
I'm using a MySQL backend, so I find my record using a select statement, and read the results into variables:
Code:
dim vTemp as c = "" dim McSelect as c = "" dim CtInsert as c = "" dim mcon as SQL::connection dim rset as SQL::ResultSet vTemp=<<%a% SELECT ..., mct_created, mct_quantity,... FROM multicerts WHERE mct_id = {session.mct_id} %a% McSelect=evaluate_string(vTemp) if mcon.open("::name::egw") if mcon.Execute(McSelect) rset=mcon.ResultSet ... xdat=rset.data("mct_created") xqty=rset.data("mct_quantity") ...
Code:
vTemp=<<%b% INSERT INTO certificates ( ...ct_created,ct_quantity,... ) VALUES ( ...{xdat},{xqty},... %b% CtInsert=evaluate_string(vTemp) dim j as n = 0 dim i as n for i = 1 to xqty if mcon.Execute(CtInsert) sleep(.5) next
I think this "helpful" format change is coming out of the evaluate_string() function.
Any thoughts on how I can get around this problem?
Pat
Comment