Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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


    William F. Robertson, Jr. Guest

  2. Similar Questions and Discussions

    1. URL FOrmat String
      Hi I am trying to learn about asp.net and I have come across the following problem. In DataGrid Columns URL format string box is not...
    2. Format Phone Number String in Datagrid Column
      Greetings, I have a 10 digit phone number stored as a string in a SQL server table. My datagrid currently displays it as 1234567890, but I would...
    3.   is not generated for null values when using a format string
      I have a DataGrid with which formats dates <ASP:TEMPLATECOLUMN SortExpression="EST_DATE" HeaderText="Est Date"> <ITEMTEMPLATE> <ASP:LABEL...
    4. format string
      Just a little question... How do I split 12345678 into 12 34 56 78??????? Christopher Brandsdal
    5. Text Format String - Please help
      Hi, I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On myGrid1 - Properties - Columns - myColumn1 - Text format string: I...
  3. #2

    Default Re: Using string format

    Hello Bill,

    Try to look at this link ...

    [url]http://www.vbcentral.net/quickstart/howto/doc/format.aspx[/url]


    Hope this helps...
    -James A Taber


    "William F. Robertson, Jr." <wfrobertson@kpmg.com> wrote in message
    news:e73LYuJTDHA.1556@TK2MSFTNGP10.phx.gbl...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139