Format Date from Oracle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AZNewsh

    #1

    Format Date from Oracle

    I am populating a datagrid with a query from Oracle, one column is a
    date field which I am populating thus:

    <asp:BoundColum n DataField="DATE _SENT" HeaderText="DAT E 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

  • OHM \( One Handed Man \)

    #2
    Re: Format Date from Oracle

    Add the following attribute to your BoundColumn

    DataFormatStrin g="{0:MM/dd/yyyy}"
    --
    ( OHM ) - One Handed Man
    AKA Terry Burns - http://TrainingOn.net
    "AZNewsh" <gn@dana.ucc.na u.edu> wrote in message
    news:1145028872 .837619.306990@ g10g2000cwb.goo glegroups.com.. .[color=blue]
    >I am populating a datagrid with a query from Oracle, one column is a
    > date field which I am populating thus:
    >
    > <asp:BoundColum n DataField="DATE _SENT" HeaderText="DAT E 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
    >[/color]


    Comment

    • AZNewsh

      #3
      Re: Format Date from Oracle

      Perfect! Thank you

      Comment

      Working...