Changing Sort criteria of DB table.

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Changing Sort criteria of DB table.

    hello

    whats the easiest way to change my recordsets sort criteria from say,
    alphabetical order to town name, am i best using sql (if so whats the code) or
    do i have to actually have to have two .asp pages with the different recordset
    criteria's??


    thanks

    jay



    juniorbee Guest

  2. Similar Questions and Discussions

    1. sort tablename in sql table
      hi.. i have several tables where I need to sort the column name in a table; asc order.. how can i do that? ex: table is abc column name: yahoo,...
    2. Sort a repeat region in a table by clicking on the table headers
      Sort a repeat region in a table by clicking on the table headers for ASP some help on this topic pls.. Rgds MeTin
    3. Weird Sort criteria
      The dataView has the following columns: CodeType, Code, Description, Amount, CodeDate CodeType can have the following...
    4. Table sort
      Hi I would like sort table. The table is createobject method (open a function and use SAP connection) and the table not use recordset. is it...
    5. Changing a html table when new data is entered into SQL table.
      Hi all, I was wondering if anyone has any ideas on how I would go about this task. What I have is a html table which is populated from 2 different...
  3. #2

    Default Re: Changing Sort criteria of DB table.

    you just need one page. call it passing a URL parameter specifying the
    field you want the recordset ordered by, retrieve it & in the SELECT
    stament use it instead a fixed field name. for example:

    yourpage.asp?sf=name

    or

    yourpage.asp?sf=town

    <%
    Dim sortedField

    sortedField = CStr(Request.QueryString("sf"))

    ....

    rsCustomers.Source = "SELECT * FROM YOUR_TABLE_NAME ORDER BY " & sortedField

    ....

    %>

    HTH,

    manuel

    juniorbee wrote:
    > hello
    >
    > whats the easiest way to change my recordsets sort criteria from say,
    > alphabetical order to town name, am i best using sql (if so whats the code) or
    > do i have to actually have to have two .asp pages with the different recordset
    > criteria's??
    >
    >
    > thanks
    >
    > jay
    >
    >
    >
    Manuel Socarras Guest

  4. #3

    Default Re: Changing Sort criteria of DB table.

    sorry, i should have added that im using javascript rather than VBscript.

    can you translate?
    juniorbee Guest

  5. #4

    Default Re: Changing Sort criteria of DB table.

    var sortedField

    not sure now but toString should be equivalent to CStr

    rsCustomers.Source = "SELECT * FROM YOUR_TABLE_NAME ORDER BY " + sortedField

    juniorbee wrote:
    > sorry, i should have added that im using javascript rather than VBscript.
    >
    > can you translate?
    Manuel Socarras 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