CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Date control in custom code

Print topic Send  topic

Author Message
Posted: 12/13/2003, 11:52 PM

I'm having a problem inserting a date field using custom code, the date appears to be empty. I have no problem with a normal insert using the record type form. In my custom code, I have an insert statement as follows:

$iSQLinvoices = "insert into invoices
values(" . CCToSQL($orders_maint->inv_date->GetValue(),ccsDate) . "," .
CCToSQL($net_value,ccsFloat) . "," .
CCToSQL($orders_maint->terms_in_days->GetValue(),ccsInteger) . ")";

And the problem seems to lie with the inv_date control. This control is not based on a database column, it is just a date control which the user will enter a date and I will retrieve the value to insert into the table. However, when I echo this control, the value is "Array". What does that mean? I have another integer control that is not based on the database and there is no problem with that so I'm assuming it is because it is a date control that is the problem.

My project date settings (and others) are all set properly. I'm using CCS2.2 and PHP/MySQL. I've tried all sorts of date conversions but to no avail since it appears that the value of the date control is empty (empty array???). Can somebody pls give me some clues/hint as to what this means?

Steve Kitchen
Posted: 12/14/2003, 3:20 AM

Hi Karen,

Yes, I've had the same problem - CCS seems to be a bit inconsistent when it comes to handling dates (it's a common problem, due to the multitude of formats used for dates by computers and humans ...:-) ).

My solution was to define my date fields as text types (as opposed to date types) and hack the values into the format the DB needs in my own code.

You'll need to play around with your code a bit to get a handle on how CCS will hold your date input. You'll find it's different for dates pulled from input fields and dates pulled from URLs ....

Good luck !!

Posted: 12/14/2003, 6:55 PM

Thanks, Steve. At least, I know it's not my code. I'll try your suggestions.


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

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