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

 datetime

Print topic Send  topic

Author Message
romeop

Posts: 6
Posted: 03/17/2004, 2:06 PM

Hi all,
I have problem with the datetime in MS SQL Server. The generated field stays empty.

If I set a datetime field to text I get the following string
'May 3 2004 12:00AM'
How do I have to set the DBFormat property. I can not figure out what is the wildcard for 'May'?

View profile  Send private message
peterr


Posts: 5971
Posted: 03/17/2004, 3:38 PM

According to MySQL manual, the DateTime field is using the 'YYYY-MM-DD HH:MM:SS' format:
http://www.mysql.com/doc/en/DATETIME.html

Therefore the "DBFormat" property must be set to reflect the database date format ("DB" stands for the database).

The "Format" property can be set to whatever you like to display. There are many selections available in CCS when you open the litsbox next to that property.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
romeop

Posts: 6
Posted: 03/18/2004, 2:39 AM

Hi Peter,
I am using MS SQL, not MySQL.
The string that I get is literally the one I wrote in the post. And there is no choice in the listbox that would match this one.
I already had similar problems with MS-SQL on a german machine, where I had to set the DBFormat to
'mm dd yyyy h:nn' (with real spaces between)
which is also not one of the choices in the list. This time it is an US/Engl machine and I have similar problems.
View profile  Send private message
peterr


Posts: 5971
Posted: 03/18/2004, 3:20 AM

Sorry about this. Regarding MS SQL:
When you select the "SQL Server" as your database in the Server Connection settings that the Database Format is automatically selected as "yyyy-mm-dd HH:nn:ss". I believe that this is the right format.
You can leave the "DBFormat" [roperty blank for all fields since it's selected in the database settings.
In practice, I think that MS SQL stores dates in a different format, but it interprets any date that looks valid. Therefore specifying "yyyy-mm-dd HH:nn:ss" as the Database Format should work with all international languages because it is always valid.
Microsoft also confirms this at http://msdn.microsoft.com/library/default.asp?url=/libr..._qd_14_3unn.asp
In CCS we use "nn" for Minutes since "mm" is used to indicate months. See: http://docs.codecharge.com/studio/html/Components/Prope...DateFormat.html

I don't see reasons to utilize database date formats other then the above, which is already setup automatically in CCS. The format in your example, 'May 3 2004 12:00AM', is displayed by the ASP program and uses your regional settings, not the database settings. It should not be used to store dates in the database.

The listbox that I wrote about is not related to "DBFormat". I was only referring to the "Format" property.

Summing up, MS SQL can interpret and display dates in different formats, but it always stores them in just one format. Therefore there should never be a need to change the DBFormat once it is set to "yyyy-mm-dd HH:nn:ss" in the Server Connection. You can leave DBFormat blank on all the pages/forms/fields.

As for the displaying the dates or allowing users to enter the dates, please use the "Format" property instead. You can select many date formats in there and see what masks are being used, while they are also listed at http://docs.codecharge.com/studio/html/index.html?http:...DateFormat.html

If you experience further problems please contact our support as they can analyze your case in more detail.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
romeop

Posts: 6
Posted: 03/18/2004, 4:11 AM

Just in case someone else runs into the same problem
In the server settings the database format is set to
'yyyy-mm-dd HH:nn:ss'

DBFormat is empty --> does NOT work
DBFormat 'yyyy-mm-dd HH:nn:ss' -->does NOT work
DBFormat 'mmm d yyyy h:nnAM/PM' -->works

strange but the only way!

Btw. I use PHP with MS-SQL set to us-english
View profile  Send private message
Trisiana
Posted: 03/23/2004, 1:11 AM

Romeo, I am using PHP/MS SQL 2000 too, and I got exactly the some problem as
you are. All the datetime field is empty when I try to run the application
in Internet Explorer http://localhost/myapplication/
Do not know what's wrong because my ASP version is running well.
I have reported this issue to support since March 20.

donsafar


Posts: 90
Posted: 04/07/2004, 7:42 PM

Did anyone ever get an answer on this from codecharge support. I am using php and ms sql and have the same issue. None of the date fields are displaying.
_________________
Don Safar
View profile  Send private message
peterr


Posts: 5971
Posted: 04/07/2004, 8:10 PM

I just checked and I see in our support system that Trisiana's support case was resolved. The support response was:
=====================
As you may know in order to display the date value in PHP you should specify the correct format in DBFormat property so that it exactly matches the one returned by the database. To find out what it is first select the "Text" data type and run the page. Check the displayed date format. E.g. in my case it was: 2002-09-24 10:00:00.000
Therefore the DBFormat would be: yyyy-mm-dd HH:nn:ss.S
(Note that it is only a sample format, while you may see another)
After configuring the DBFormat properly you can select the "Date" data type for your field.
=====================

BTW, Don, you're welcome to contact our support as well. We may even offer you one answer free of charge ;-)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Don Safar
Posted: 04/07/2004, 8:50 PM

My date format turned out to be like romeop, so I put this in the DBFormat
field -- mmm d yyyy h:nnAM/PM -- and the date now displays. I try not to
bother support if I think someone else may have solved it and will report on
it in the forums. You are doing a great job. Thank you for all the hard
work.

"peterr" <peterr@forum.codecharge> wrote in message
news:54074c29ad5d25@news.codecharge.com...
> I just checked and I see in our support system that Trisiana's support
case was
> resolved. The support response was:
> =====================
> As you may know in order to display the date value in PHP you should
specify
> the correct format in DBFormat property so that it exactly matches the one
> returned by the database. To find out what it is first select the "Text"
data
> type and run the page. Check the displayed date format. E.g. in my case it
was:
> 2002-09-24 10:00:00.000
> Therefore the DBFormat would be: yyyy-mm-dd HH:nn:ss.S
> (Note that it is only a sample format, while you may see another)
> After configuring the DBFormat properly you can select the "Date" data
type for
> your field.
> =====================
>
> BTW, Don, you're welcome to contact our support as well. We may even offer
you
> one answer free of charge ;-)
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Obe
Posted: 12/08/2004, 1:39 AM

Codecarge 2.3 (trying), MSSQL 2000 Server, Win XP Prof + SP2 PL (Poland);
database format is set to 'yyyy-mm-dd HH:nn:ss';
project format 'dd/mm/yyyy'.

It's not working .... :-(.

I have date format 7 gru 2004 5:33 (d mmm yyyy h:nn) or 7 gru 2004 13:15 (d mmm yyyy hh:nn) but displays as text only. As date not displays.

I wanna to buy codecharge but I have a problem with the date.
JohnDoranNY

Posts: 3
Posted: 01/19/2005, 10:56 AM

I'm having a strange problem now with Date as well using PHP with MS SqlServer 2000. I think the problem started when the database was changed from a stand alone to a 'Distributor/Subscriber". The date used to show up on forms but since then it does not.

I have read all the above and am not any closer to solving the problem.

I changed the format on the form from Date to Text and now I see this:

Jan 19 2005 12:00AM

(It used to be 01/19/2005 12:00:00)

Okay, so since this format is not on the list for SQL Server, I created the dbformat to be

mmm d yyyy hh:nnAMPM

Changed the field back to Date with that dbformat, still does not show.

Does anyone here know (1) is it possible to configure 'per database' the format for smalldatetime? (I'd rather it be mm/dd/yyyy as before) and (2) how can I get dates to work again under PHP/MS Sql (PHP 4).

Thanks
View profile  Send private message
JohnDoranNY

Posts: 3
Posted: 01/19/2005, 11:50 AM

Nevermind... there seems to be a TYPO in the CCS Documentation for Date Time. AMPM (as its listed) does not work, but RomeoP's suggestion of AM/PM does work.

I'm still curious if this is a setting that is per-database configurable or not.... thanks
View profile  Send private message
peterr


Posts: 5971
Posted: 01/20/2005, 9:58 AM

John,
Where did you see that typo? I 've look at the docs and I also see AM/PM format but not AMPM for CCS.
See http://docs.codecharge.com/studio/html/Components/Prope...DateFormat.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.

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.