Asp query (SQL Related)

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

    Asp query (SQL Related)


    I have two resultset in asp as follows

    database is sql

    AttributeText

    700 Kbps
    128 Kbps
    $59.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98

    1 Mbps
    200 Kbps
    $69.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98

    1.5 Mbps
    200 Kbps
    $79.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98

    1.5 Mbps
    300 Kbps
    $99.99
    15 Months
    15 Months
    - $100
    $699.98

    2.0 Mbps
    500 Kbps
    $179.99
    15 Months
    15 Months
    $799.98
    - $100
    $699.98

    Attribute Description

    Max. Download Speed
    Max. Upload Speed
    Monthly Fees
    Term Commitment
    Hardware Warranty
    Equipment and Standard Installation
    Mail-In Rebate
    Your Final Cost


    I want to display output as follows

    Max. Download Speed 700 Kbps 1
    Mbps 1.5 Mbps -- --
    Max. Upload Speed 128 Kbps 200
    Kbps 200 Kbps -- --
    Monthly Fees $59.99
    $69.99 $79.99 -- --
    Term Commitment 15 Months 15
    Months 15 Months -- --
    Hardware Warranty 15 Months 15
    Months 15 Months -- --
    Equipment and Standard Installation $499.98 $499.98
    $499.98 -- --
    Mail-In Rebate - $100 -
    $100 - $100 -- --
    Your Final Cost $399.98
    $399.98 $399.98 -- --

    Is this possible with asp code or i will have to change my database
    design

    Thanks in advance

    Nitin

  • AlterEgo

    #2
    Re: Asp query (SQL Related)

    Nitin,

    Assuming your database is designed properly, don't change your database to
    accomodate presentation requirements. Change your presentation layer to
    re-format the data. Yes, you have a great deal of flexibility in ASP to
    accomplish this.

    -- Bill


    "Nitin" <nitinroman@gma il.comwrote in message
    news:1172683891 .577882.78150@q 2g2000cwa.googl egroups.com...
    >
    I have two resultset in asp as follows
    >
    database is sql
    >
    AttributeText
    >
    700 Kbps
    128 Kbps
    $59.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98
    >
    1 Mbps
    200 Kbps
    $69.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98
    >
    1.5 Mbps
    200 Kbps
    $79.99
    15 Months
    15 Months
    $499.98
    - $100
    $399.98
    >
    1.5 Mbps
    300 Kbps
    $99.99
    15 Months
    15 Months
    - $100
    $699.98
    >
    2.0 Mbps
    500 Kbps
    $179.99
    15 Months
    15 Months
    $799.98
    - $100
    $699.98
    >
    Attribute Description
    >
    Max. Download Speed
    Max. Upload Speed
    Monthly Fees
    Term Commitment
    Hardware Warranty
    Equipment and Standard Installation
    Mail-In Rebate
    Your Final Cost
    >
    >
    I want to display output as follows
    >
    Max. Download Speed 700 Kbps 1
    Mbps 1.5 Mbps -- --
    Max. Upload Speed 128 Kbps 200
    Kbps 200 Kbps -- --
    Monthly Fees $59.99
    $69.99 $79.99 -- --
    Term Commitment 15 Months 15
    Months 15 Months -- --
    Hardware Warranty 15 Months 15
    Months 15 Months -- --
    Equipment and Standard Installation $499.98 $499.98
    $499.98 -- --
    Mail-In Rebate - $100 -
    $100 - $100 -- --
    Your Final Cost $399.98
    $399.98 $399.98 -- --
    >
    Is this possible with asp code or i will have to change my database
    design
    >
    Thanks in advance
    >
    Nitin
    >

    Comment

    • Larry Linson

      #3
      Re: Asp query (SQL Related)

      This newsgroup is for questions, answers, and discussions of Microsoft
      Access database software, and your question does not deal with that
      software. You "got lucky" and received one (very good and accurate)
      response, but you'll have better luck getting useful responses if you post
      ASP-with-SQL-Server questions in a newsgroup dealing with that subject.
      Good luck.

      Larry Linson
      Microsoft Access MVP

      "Nitin" <nitinroman@gma il.comwrote
      >
      I have two resultset in asp as follows
      >
      database is sql

      Comment

      • chris.nebinger@gmail.com

        #4
        Re: Asp query (SQL Related)

        You could do:


        <%
        rst.open SQLSTATEMENT, CONNECTION
        %>
        <table>
        <tr>
        <%
        For i = 0 to rst.fields.coun t-1
        response.write "<th>" & rst.fields(i).N ame & "</th>"
        Next
        %>
        </tr>
        <%
        Do until rst.eof
        response.write "<tr>"
        For i = 0 to rst.fields.coun t-1
        response.write "<td>" & rst.fields(i).V alue& "</td>"
        Next
        response.write "</tr>"
        rst.movenext
        loop
        %>



        Chris Nebinger

        On Feb 28, 11:12 am, "Larry Linson" <boun...@localh ost.notwrote:
        This newsgroup is for questions, answers, and discussions of Microsoft
        Access database software, and your question does not deal with that
        software. You "got lucky" and received one (very good and accurate)
        response, but you'll have better luck getting useful responses if you post
        ASP-with-SQL-Server questions in a newsgroup dealing with that subject.
        Good luck.
        >
        Larry Linson
        Microsoft Access MVP
        >
        "Nitin" <nitinro...@gma il.comwrote
        >
        >
        I have two resultset in asp as follows
        >
        database is sql

        Comment

        • chris.nebinger@gmail.com

          #5
          Re: Asp query (SQL Related)

          OOPS, I really need to read closer. Assuming rst is the field names,
          and rst1 is the values:
          (Also, assuming classic asp. If it's .net, i can post that code too.)

          <%
          rst.open "SELECT FIELDNAMES",con nection
          rst1.open "SELECT FIELD VALUES", connection
          response.write "<Table>"
          response.write "<tr>"
          do until rst.eof
          response.write "<td>" & rst(0) & "</td>"
          rst.movenext
          loop
          response.write "</tr>"
          response.write "<tr>"
          do until rst.eof


          rst.movenext
          loop

          Okay, i'm not sure of the format. How are you linking the fields?
          Looking at your data, is there a record with a blank to delineate the
          data? I guess I'm not sure how that would work. Could you give more
          info on the values?


          Chris

          On Feb 28, 4:39 pm, "chris.nebin... @gmail.com"
          <chris.nebin... @gmail.comwrote :
          You could do:
          >
          <%
          rst.open SQLSTATEMENT, CONNECTION
          %>
          <table>
          <tr>
          <%
          For i = 0 to rst.fields.coun t-1
          response.write "<th>" & rst.fields(i).N ame & "</th>"
          Next
          %>
          </tr>
          <%
          Do until rst.eof
          response.write "<tr>"
          For i = 0 to rst.fields.coun t-1
          response.write "<td>" & rst.fields(i).V alue& "</td>"
          Next
          response.write "</tr>"
          rst.movenext
          loop
          %>
          >
          Chris Nebinger
          >
          On Feb 28, 11:12 am, "Larry Linson" <boun...@localh ost.notwrote:
          >
          >
          >
          This newsgroup is for questions, answers, and discussions of Microsoft
          Access database software, and your question does not deal with that
          software. You "got lucky" and received one (very good and accurate)
          response, but you'll have better luck getting useful responses if you post
          ASP-with-SQL-Server questions in a newsgroup dealing with that subject.
          Good luck.
          >
          Larry Linson
          Microsoft Access MVP
          >
          "Nitin" <nitinro...@gma il.comwrote
          >
          I have two resultset in asp as follows
          >
          database is sql- Hide quoted text -
          >
          - Show quoted text -

          Comment

          Working...