Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "Help with asp display / recordset (troubleshoot)" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old June 26th, 2008, 11:34 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Question Help with asp display / recordset (troubleshoot)

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
All the other fields are in the correct order, and data is good...just Q1Shipped it shifted down one.

Wondering if anyone has any advice here and maybe any best practices you have when working with something like this...where to look/try?
Reply With Quote
Sponsored Links
  #2  
Old June 26th, 2008, 11:42 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

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
Reply With Quote
  #3  
Old June 26th, 2008, 11:53 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

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
%>
Reply With Quote
  #4  
Old June 26th, 2008, 12:22 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

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
Show us how it should look
Reply With Quote
  #5  
Old June 26th, 2008, 12:31 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

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
push up the shipped value in red----get rid of the blank.
Reply With Quote
  #6  
Old June 26th, 2008, 12:34 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Probably an issue with the query. Post that so we can examine
Reply With Quote
  #7  
Old June 26th, 2008, 12:43 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

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
pulling this from sql view with four tables, do you need that one?
Reply With Quote
  #8  
Old June 26th, 2008, 12:51 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Quote:
Originally Posted by Rebelle View Post
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
pulling this from sql view with four tables, do you need that one?
Since that has your joins and what not, it would be helpful.

Have you tried running this in Query Analyzer? If so, what were the results?
Reply With Quote
  #9  
Old June 26th, 2008, 02:20 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

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
btw - i'm ordering by toolname not toolid, would this be part of the issue?

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
Reply With Quote
  #10  
Old June 26th, 2008, 07:52 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Post your View...
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 02:38 PM.



Content Relevant URLs by vBSEO 3.2.0