Jean-François ROY
|
| Posted: 02/19/2003, 9:07 AM |
|
Hello,
I'm having a difficult time formatting the date from a MySQL database from a
timestamp field to a more friendly onscreen format. I've used all the
formats in the properties to see the date but nothing seems to be working.
I'm only able to see the date like 20030129095238 when I use the text format
but then it's not very user friendly is it?
I tried a before show event but I'm not sure this is the best way to handle
it.
The formatting is only for displaying the date.
Does anybody knows how to do this in Code Charge Studio or at least point me
to a tutorial or some help on the issue?
Thank you,
Jean-François
|
|
|
 |
DAVID
|
| Posted: 02/21/2003, 10:33 AM |
|
First open build quiery and check all fields you need in your grid.
Then switch from table to SQL data source type
Finally wrap the DATE_FORMAT function arround your timestamp field
EX:
SELECT DATE_FORMAT(TIMESTAMP_FIELD, '%Y-%m-%d %T' );
"Jean-François ROY" <jfroy@wanadoo.fr> wrote in message
news:b30dk5$gvf$1@news.codecharge.com...
> Hello,
>
> I'm having a difficult time formatting the date from a MySQL database from
a
> timestamp field to a more friendly onscreen format. I've used all the
> formats in the properties to see the date but nothing seems to be working.
>
> I'm only able to see the date like 20030129095238 when I use the text
format
> but then it's not very user friendly is it?
>
> I tried a before show event but I'm not sure this is the best way to
handle
> it.
>
> The formatting is only for displaying the date.
>
> Does anybody knows how to do this in Code Charge Studio or at least point
me
> to a tutorial or some help on the issue?
>
> Thank you,
>
> Jean-François
>
>
|
|
|
 |
RonB
|
| Posted: 02/22/2003, 1:10 AM |
|
Set the field to date and use the format and dbformat boxes in the
prpperties section. There are two ways to do this:
1. choose one of the pre defined formats in format and select the
yyymmddHHnnss in dbformat.
2. in the format box type the format you want (dd-mm-yyyy or dd mmmm yyyy
etc) in dbformat select or type yyyymmddHHnnss
No coding needed.
Ron
"Jean-François ROY" <jfroy@wanadoo.fr> schreef in bericht
news:b30dk5$gvf$1@news.codecharge.com...
> Hello,
>
> I'm having a difficult time formatting the date from a MySQL database from
a
> timestamp field to a more friendly onscreen format. I've used all the
> formats in the properties to see the date but nothing seems to be working.
>
> I'm only able to see the date like 20030129095238 when I use the text
format
> but then it's not very user friendly is it?
>
> I tried a before show event but I'm not sure this is the best way to
handle
> it.
>
> The formatting is only for displaying the date.
>
> Does anybody knows how to do this in Code Charge Studio or at least point
me
> to a tutorial or some help on the issue?
>
> Thank you,
>
> Jean-François
>
>
|
|
|
 |
|