telmiger
Posts: 61
|
| Posted: 04/25/2005, 7:15 PM |
|
I am trying to insert a date field into a database with in after execute update event.
My date field is formatted to mm/dd/yy.
The code below works if I formatt my date_1 field to yyyy-mm-dd. I would prefer to have the entry field formatted to mm/dd/yy and convert the date before it gets inserted into the database to yyyy-mm-dd.
I tried everything I could come up with but nothing works. Does anybody know of an easy way to convert the date before inserting.
global $evidence_custody;
global $DBcns;
$EmpProjectConn = new clsDBcns();
global $custody_type_id;
global $date_1; // Reads from date_1 field that is formatted to mm/dd/yy
global $comments;
global $contact_name;
global $company_1;
global $contact_name;
// $date_1 convert from mm/dd/yy to yyyy/mm/dd ????
$DBcns->query ("Insert into evidence_custody
("
. "evidence_id,"
. "project_id,"
. "custody_type_id,"
. "date_1 ,"
. "contact_company_2 , "
. "company_1 "
. ") VALUES ("
.$evidence_custody->evidence_id->GetValue() .","
.$evidence_custody->project_id->GetValue() .","
.$EmpProjectConn->ToSQL($custody_type_id, ccsInteger).","
.$EmpProjectConn->ToSQL($date_1, ccsDate) .","
.$EmpProjectConn->ToSQL($contact_name, ccsText).","
.$EmpProjectConn->ToSQL($company_1, ccsText).","
")");
Tony Elmiger
|
 |
 |
Nicole
Posts: 586
|
| Posted: 04/26/2005, 2:14 AM |
|
Hello,
I recommend you to contact YesSoftware support (http://support.yessoftware.com/support_new.asp) regarding date formatting
_________________
Regards,
Nicole |
 |
 |
|