DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

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). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 26th, 2008, 11:34 AM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
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 (permalink)  
Old June 26th, 2008, 11:42 AM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft .Net Microsoft SQL Server 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
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Reply With Quote
  #3 (permalink)  
Old June 26th, 2008, 11:53 AM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
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 (permalink)  
Old June 26th, 2008, 12:22 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft .Net Microsoft SQL Server 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 (permalink)  
Old June 26th, 2008, 12:31 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
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 (permalink)  
Old June 26th, 2008, 12:34 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

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

Default

Probably an issue with the query. Post that so we can examine
Reply With Quote
  #7 (permalink)  
Old June 26th, 2008, 12:43 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
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 (permalink)  
Old June 26th, 2008, 12:51 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft .Net Microsoft SQL Server 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 (permalink)  
Old June 26th, 2008, 02:20 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
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 (permalink)  
Old June 26th, 2008, 07:52 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft .Net Microsoft SQL Server 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


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 07:46 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46