CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Date: I just don't get it.......

Print topic Send  topic

Author Message
JokeCoat
Posted: 01/11/2003, 4:19 PM

Please help me.....sigh!
I'm using CodeCarge Studio with MySQL and PHP.

My appl. is this:
- I'm using a MS Access DB as front-end
- MySQL as back-end
- the web for publising (via CodeChargeStudio)

The problem is in the date:
We normalt use dd-mm-yyyy for date input. But MySQL changes the date into yyyy-mm-dd HH:mm:ss
I don't need; I don't want; I hate (!!) the time notation

I'm going real crazy about it, please help me!!!

I just want date(s)...: no f**##***g times

JokeCoat
RonB
Posted: 01/12/2003, 11:56 AM

CCS allows you to view date's in anny format you can think off. It has some sample formats wich you see in the propperties box. set data type of the datefield to date and just type in the next box valled format: dd-mm-yyyy
at the bottom of the prppertiesbox is a field called DBFormat here you type yyyy-mm-dd and delete the trailing time bit. It's confusing but once you understand that these aren't just dropdownlists but that you can type your own date formates you'll be pleased to see that you hae complete control over date formats.

Ron
JamesR
Posted: 01/12/2003, 6:13 PM

Ive been hunting down the regular expression for Access and Codecharge for the day of the year and week of year , has anyone seen this formula.

Also a really complicated one..how at 5.00pm local time can I manipulate the Database to show the next business day.

5 trillion genius pts for the right answer.

and 2 trillion for the wrong answer:)
Jokecoat
Posted: 01/13/2003, 8:56 AM

Ron tnx for you reply. I knew that already.

But I use a pull-down to search on de date. But you can't search dd-mm-yyyy when MySQL uses yyyy-mm-dd (date)

So now I use text instead of date (:-(()
RonB
Posted: 01/14/2003, 3:03 AM

if the user chooses a date from a pulldown menu you can add a beforeshow event and do the date formatting in PHP

global $yourgrid;
function showdbdate($field)
{
$day = substr($field, 8, 2);
$month = substr($field, 5, 2);
$year = substr($field, 0, 4);
$field= $day . "-" . $month . "-" .$year;
return $field;
}
$yourgrid->yourdropdown->setvalue(showdbdate($yourgrid->yourdropdown->Value));

That should work
RonB
Posted: 01/14/2003, 3:31 AM


Dont now if you'll ever need it but here's the revers of the showdbdate function if you need to convert the value to the mysql format and you cant use the date formatting feature of CCS:

function dbdate($field)
{
$day = substr($field, 0, 2);
$month = substr($field, 3, 2);
$year = substr($field, 6, 4);
$field= $year . "-" . $month . "-" .$day;
return $field;
}

Ron

   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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