![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| All, Right now, it looks like the my data is correct, it's just one column (Q1Shipped) that I am summing it not displaying in the correct spot. Code: Ex: ToolName Q1Build Q1Shipped Q2Build Q3Build Q4Build Tool1 1 BLANK(skipped) 3 3 2 Tool2 3 2 (this is suppose 2 go with Tool1) 3 2 2 Tool3 2 1 (this is suppose 2 go with Tool2) 3 3 4 Wondering if anyone has any advice here and maybe any best practices you have when working with something like this...where to look/try? |
| Sponsored Links |
|
#2
| ||||
| ||||
| Belle, I don't understand what you're asking ![]() Posting your current code would be helpful, as well.
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| okies ...here it is:The strQ1Shipped is not lining up with the correct row in the asp display. it's starting on the 2nd tool....The number is correct, just needs to start on 1st tool. Code: <%
strLastTools = ""
do while not rs.EOF
if i > iStopRec then
exit do
end if
strTools = rs("Tools")
strQ1 = rs("OnOrder1")
strQ1Shipped = strQ1Shipped + rs("SumShipped")
strQ2 = rs("OnOrder2")
strQ3 = rs("OnOrder3")
strQ4 = rs("OnOrder4")
strToolID = rs("ToolID")
If strTools<>strLastTools Then
Response.Write("<tr><td colwidth=""150""><b>" & strTools & "</b></a></td>")
Response.Write("<td align=center colwidth=""50""><b>" & strQ1 & "</b></td>")
strQ1 = 0
If strQ1Shipped <> 0 then
Response.Write("<td align=center colwidth=""50""><A href=""//server/test/ShipResults.asp?ToolID=" & strToolID &"""><b>" & strQ1Shipped & "</b></a></td>")
strQ1Shipped = 0
Else
Response.Write("<td align=center colwidth=""50""><b>" & strQ1Shipped & "</b></td>")
strQ1Shipped = 0
End If
Response.Write("<td align=center colwidth=""50""><b>" & strQ2 & "</b></td>")
strQ2 = 0
Response.Write("<td align=center colwidth=""50""><b>" & strQ3 & "</b></td>")
strQ3 = 0
Response.Write("<td align=center colwidth=""50""><b>" & strQ4 & "</b></td></tr>")
strQ4 = 0
End If
strLastTools = strTools
%>
<%
i = i + 1
rs.MoveNext
loop
%>
|
|
#4
| ||||
| ||||
| In the ToolName column, do you want Tools to repeat themselves? i.e.: Code: ToolName Q1Build Q1Shipped Q2Build Q3Build Q4Build Tool1 1 BLANK(skipped) 3 3 2 Tool1 1 2 3 2 2 Tool2 3 2 (this is suppose 2 go with Tool1) 3 2 2 Tool3 2 1 (this is suppose 2 go with Tool2) 3 3 4 |
|
#5
| ||||
| ||||
| Hi JMH, Nope, grouping toolname and the onorder/build columns. Code: instead of this: tool1---------1---------blank---------3--------3------2 tool2---------3-----------2-----------3--------2------2 tool3---------2-----------1-----------3--------3------4 want this: tool1---------1-----------2---------3--------3------2 tool2---------3-----------1-----------3--------2------2 tool3---------2-----------3-----------3--------3------4 |
|
#7
| ||||
| ||||
| Hey again JMH, ![]() i have this in my asp: Code: sSQL = "Select ToolID,Tools,CurrentMoYr,OnOrder1,OnOrder2,OnOrder3,OnOrder4,MoID,RolloutShipped,Sum(case when [MoID] between 1 and 3 then (IsNull([RolloutShipped],0)) end) as SumShipped from vwHistory where 1=1 Group By ToolID,Tools,CurrentMoYr,OnOrder1,OnOrder2,OnOrder3,OnOrder4,MoID,Rolloutshipped Order By " & sOrderBy & " " & sOrderByDir |
|
#8
| ||||
| ||||
| Quote:
Have you tried running this in Query Analyzer? If so, what were the results? |
|
#9
| ||||
| ||||
| hope this helps explain more.... I was pulling from both tables .... the history table and the tool table...which there will be more tools in my tool table than in my history table (which would be nice to see but not necessary...they'll eventually show up in the history table once they have history data)....so i changed that join. when i used the sql statement in the analyzer for toolID=1, i get results: Code: ToolID----ToolName----OnOrder1----SumShipped----MoID 1---------Tool1----------3------------0--------------1 1---------Tool1----------3------------1--------------2 1---------Tool1----------3------------1--------------3 right now my asp display looks like: Code: ToolName-----Q1Build------Q1Shipped Tool5----------2-------------BLANK Tool7----------4---------------3 Tool1----------3---------------5 Tool3----------2---------------2 Last edited by Rebelle; June 26th, 2008 at 08:12 PM. Reason: added asp display |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|