CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Date conversion before inserting into database

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.