Using string format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William F. Robertson, Jr.

    #1

    Using string format

    I have a question about the string formatting function.

    I have a field in a database that is coming back as a 6 digit date:

    061503

    I would like to format this out to 06/15/03 to be displayed on a page.

    What StringFormat parameter do I apply to the Column to get this desired
    result? Or should I be converting in in the SqlQuery? If the query option
    is the correct one, how do I do that in the query.

    Currently the field is a nvarchar that gets converted to varchar

    SELECT Convert( varchar, Cycle, 1 ) as CycleDate FROM ...

    Thanks,

    bill


  • James A Taber

    #2
    Re: Using string format

    Hello Bill,

    Try to look at this link ...




    Hope this helps...
    -James A Taber


    "William F. Robertson, Jr." <wfrobertson@kp mg.com> wrote in message
    news:e73LYuJTDH A.1556@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I have a question about the string formatting function.
    >
    > I have a field in a database that is coming back as a 6 digit date:
    >
    > 061503
    >
    > I would like to format this out to 06/15/03 to be displayed on a page.
    >
    > What StringFormat parameter do I apply to the Column to get this desired
    > result? Or should I be converting in in the SqlQuery? If the query[/color]
    option[color=blue]
    > is the correct one, how do I do that in the query.
    >
    > Currently the field is a nvarchar that gets converted to varchar
    >
    > SELECT Convert( varchar, Cycle, 1 ) as CycleDate FROM ...
    >
    > Thanks,
    >
    > bill
    >
    >[/color]


    Comment

    Working...