![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#11
| ||||
| ||||
| ok... here it is:Code: SELECT dbo.tblTools.Tools, dbo.tblTools.OnOrder1, dbo.tblTools.OnOrder2, dbo.tblTools.OnOrder3, dbo.tblTools.OnOrder4,
dbo.tblHistory.CurrentMoYr, SUM(dbo.tblHistory.RolloutShipped) AS SumShipped, dbo.tblHistory.RolloutShipped,
dbo.tblHistory.DistrictID, dbo.tblHistory.RegionID, dbo.tblTools.MeetingID, dbo.tblRegion.RegionName,
dbo.tblDistricts.District_Location, dbo.tblHistory.MoID, dbo.tblHistory.ToolID
FROM dbo.tblHistory INNER JOIN
dbo.tblRegion ON dbo.tblHistory.RegionID = dbo.tblRegion.RegionID INNER JOIN
dbo.tblDistricts ON dbo.tblHistory.DistrictID = dbo.tblDistricts.DistrictID LEFT OUTER JOIN
dbo.tblTools ON dbo.tblHistory.ToolID = dbo.tblTools.ToolID
GROUP BY dbo.tblTools.Tools, dbo.tblTools.OnOrder1, dbo.tblTools.OnOrder2, dbo.tblTools.OnOrder3, dbo.tblTools.OnOrder4,
dbo.tblHistory.CurrentMoYr, dbo.tblHistory.RolloutShipped, dbo.tblHistory.DistrictID,
dbo.tblHistory.RegionID, dbo.tblTools.MeetingID, dbo.tblRegion.RegionName, dbo.tblDistricts.District_Location,
dbo.tblHistory.MoID, dbo.tblHistory.ToolID
HAVING (dbo.tblTools.MeetingID = 1) OR
(dbo.tblTools.MeetingID = 2)
|
| Sponsored Links |
|
#12
| ||||
| ||||
| If Query Analyzer returns the correct data, then you're right, it's probably an issue with the ASP logic. Have you checked your page source after the page is rendered? That might give a hint as to where the logic is wrong.
__________________ 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 |
|
#13
| ||||
| ||||
| Quote:
![]() i don't understand why it shows the correct toolID just not the right shipped qty value......if my first record strQ1Shipped value is NULL, should the below be an issue? remember i'm handling the null in the asp side sql statement to make 0. See anything weird? Code: 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
Last edited by Rebelle; June 27th, 2008 at 11:41 AM. |
|
#14
| ||||
| ||||
| can you show me what the query returns in the query analyzer? after i see that, i'll take a look at your ASP code and see where the issue might be.
__________________ Quote of the Month: Quality: The race for quality has no finish line- so technically, it's more like a death march. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 |
|
#15
| ||||
| ||||
| okie here is it mehere.... this is taking the sql statement i have on the asp page from the sql vw. sorry it's the most i could fit on the screen, the 3rd tool listed has more records that add up to (5)...but what you see on attachment is all i could fit in.... but my asp looks like below, it's starting off with (0) on Q1Shipped and pushed the results down by 1, making that (5) show up on tool 4. Code: Tools | Q1-08 |Q1 Shipped |Q2-08| Q3-08 |Q4-08 tool1 | 0 |0 |0 |0 | 0 tool2 | 5 | 0 |5 |4 | 4 tool3 |10 | 0 |4 |4 | 4 tool4 | 6 |5 |4 |4 | 4 |
|
#16
| ||||
| ||||
| which post has your code for the display? sorry ... i'm just working between 2 desks and i don't have time to really look for it. or if you can post it again, that would be good. |
|
#17
| ||||
| ||||
| Quote:
|
|
#18
| ||||
| ||||
| okie dokie ... change this line: Code: If strTools<>strLastTools Then Code: If strTools<>strLastTools and strLastTools <> "" Then however, because you need to read the records and to get your total before posting, you will also need to get prev values for all your other records as well. so, in essence you need something like this: Code: do while not rs.EOF
if i > iStopRec then
exit do
end if
strTools = rs("Tools")
strQ1 = rs("OnOrder1")
if strTools <> strLastTools then
strQ1Shipped = rs("SumShipped")
else
strQ1Shipped = strQ1Shipped + rs("SumShipped")
end if
strQ2 = rs("OnOrder2")
strQ3 = rs("OnOrder3")
strQ4 = rs("OnOrder4")
strToolID = rs("ToolID")
If strTools<>strLastTools and strLastTools <> "" or rs.EOF Then'I'm not sure if the rs.EOF will work. Just a thought.
Response.Write("<tr><td colwidth=""150""><b>" & strLastTools & "</b></a></td>")
Response.Write("<td align=center colwidth=""50""><b>" & strPrevQ1 & "</b></td>")
If strPrevQ1Shipped <> 0 then
Response.Write("<td align=center colwidth=""50""><A href="http://www.developerbarn.com/asp-development/"//server/test/ShipResults.asp?ToolID=" & strPrevID &"""><b>" & strPrevQ1Shipped & "</b></a></td>")
Else
Response.Write("<td align=center colwidth=""50""><b>" & strPrevQ1Shipped & "</b></td>")
End If
Response.Write("<td align=center colwidth=""50""><b>" & strPrevQ2 & "</b></td>")
Response.Write("<td align=center colwidth=""50""><b>" & strPrevQ3 & "</b></td>")
Response.Write("<td align=center colwidth=""50""><b>" & strPrevQ4 & "</b></td></tr>")
End If
strLastTools = strTools
strPrevQ1Shipped = strQ1Shipped
strPrevQ2 = strQ2
strPrevQ3 = strQ3
strPrevQ4 = strQ4
strPrevID = strToolID
%>
<%
i = i + 1
rs.MoveNext
loop
%>
give the above code a shot. if the rs.EOF fails in the IF/Then statement, we're going to have to look at a stored proc to do this. Last edited by mehere; June 27th, 2008 at 01:06 PM. |
| The Following User Says Thank You to mehere For This Useful Post: | ||
Rebelle (June 27th, 2008) | ||
|
#19
| ||||
| ||||
| if this doesn't work ... and i'm not too confident it will, if you could provide me with your table layout and sample data, i could work on a query or stored proc that will get you the data you need. |
|
#20
| ||||
| ||||
| Thanks Mehere, Gave it a try and it's close but not yet lined up.... when I tried all the changes, it now does line up the q1Shipped column with the other qtr columns, but it got rid of tool1 so it now unaligned toolname with the other columns.... Code: ex: tool2----------q1 for tool1 value------q1Ship for tool1 value----other cols. tool3----------q1 for tool2 value------q1Ship for tool2 value----other cols. tool4----------q1 for tool3 value------q1Ship for tool3 value----other cols. ![]() Disregard the above, I had strTools displaying instead of strLastTools on the response.write line....it lines things up starting with tool1 but it's just not showing the last line (last tool with other columns). w00t! Last edited by Rebelle; June 27th, 2008 at 02:09 PM. Reason: read text in blue! |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|