SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Urgent Help Neede

    Hi All ,

    Will anybody plz help me...

    http://www.sitepoint.com/forums/showthread.php?t=456595


    Thnx

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    Code:
    Do While Not objRS.EOF
    	&#37;><tr><%
    	For Each oField In objRS.Fields
    		%><td<%
    		Select Case oField.Name
    		Case "Commodity" ' if you want more fields center aligned you can add more field names here in a delimited list
    			%> align="center"<%
    		Case Else
    			%> align="right"<% ' or left, right is normally better for numbers so the decimals line up
    		End Select
    		%>><%=FormatNumber(oField.Value,3)%></td>
    	Next
    	%></tr><%
    	objRS.MoveNext
    Loop

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much..

    Can You please embed it in my code... I really find it difficult to include this code into my page.

    I will be very grateful if you could do that for my.

    Thanks,

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is the code

    ..............................................

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=MSDAORA;Data Source=compas;User Id=compas_isbx002;Password=isbx002;"
    dim vv
    vv=request.querystring("btn")


    Set objRs = objConn.Execute("SELECT STORED_COMMODITIES.COMMODITY_CODE Commodity,Sum(STORED_COMMODITIES.NUMBER_OF_UNITS) Units, Sum(STORED_COMMODITIES.QUANTITY_NET) Net, Sum(STORED_COMMODITIES.QUANTITY_GROSS) Gross FROM STORED_COMMODITIES where STORED_COMMODITIES.OFFID='"&vv&"' GROUP BY STORED_COMMODITIES.COMMODITY_CODE")
    Response.Write "<table border=1 cellpadding=4>"
    Response.Write "<tr>"

    For I = 0 To objRS.Fields.Count - 1
    Response.Write "<td align=center><b>" & objRS(I).Name & "</b></td>"
    Next

    Response.Write "</tr>"

    Do While Not objRS.EOF
    Response.Write "<tr>"

    For I = 0 To objRS.Fields.Count - 1
    Response.Write "<td align=center>" & objRS(I) & "</td>"
    Next

    Response.Write "</tr>"

    objRS.MoveNext
    Loop

    Response.Write "</table>"



    objRs.Close
    objConn.Close
    ...............................


Bookmarks

Posting Permissions

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