Home All Groups Group Topic Archive Search About

Format Date from Oracle

Author
14 Apr 2006 3:34 PM
AZNewsh
I am populating a datagrid with a query from Oracle, one column is a
date field which I am populating thus:

<asp:BoundColumn DataField="DATE_SENT" HeaderText="DATE SENT">
    <ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:BoundColumn>

The problem is that it displays as the Oracle default of date time
AM/PM where as I only want to see the date like 4/14/2006

How would I convert this? do I do it in the SQL or whilst populating
the datagrid and how?

Thanks in advance

Author
14 Apr 2006 4:32 PM
OHM ( One Handed Man )
Add the following attribute to your BoundColumn

DataFormatString="{0:MM/dd/yyyy}"
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
Show quoteHide quote
"AZNewsh" <g*@dana.ucc.nau.edu> wrote in message
news:1145028872.837619.306990@g10g2000cwb.googlegroups.com...
>I am populating a datagrid with a query from Oracle, one column is a
> date field which I am populating thus:
>
> <asp:BoundColumn DataField="DATE_SENT" HeaderText="DATE SENT">
> <ItemStyle HorizontalAlign="Left"></ItemStyle>
> </asp:BoundColumn>
>
> The problem is that it displays as the Oracle default of date time
> AM/PM where as I only want to see the date like 4/14/2006
>
> How would I convert this? do I do it in the SQL or whilst populating
> the datagrid and how?
>
> Thanks in advance
>
Author
14 Apr 2006 4:54 PM
AZNewsh
Perfect! Thank you