Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop problem

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hello guys.... need your help on this:
<%
' to know what work week is today
today=date()
cur_ww=cint(DateDiff(&quot;ww&quot;,#30-12-2000#,(today),1,1))

for i=1 to cur_ww
'print the workweek
%><Table border=1>
<td>ww <%=i%></td>
<td><%
'check in the database for the records match the
criteria
while not results.eof
'check workweek for each record's date_close
workweek=cint(DateDiff(&quot;ww&quot;,#30-12-2000#,(results(&quot;date_close&quot;)),1,1))
'i stuck here!!!!!!!!
'find all the workweek that equal to i and the category is downtime.if got record, grab the amount field value and accumulated if with the other records with the same category and workweek.
'find all workweek that equal to i and category is quality. accumulate the amount.

How to do that?

Please help.



 
To me the solution to this problem is writing a Stored Procedure in T-SQL.

br
Gerard
 
Discusmania-

Let me know some more details about what is needed here. I am a consultand at Intel right now and I am familiar with this concept. I have both script and tsql solutions.

Also, If you work here at Intel, doesn't this years first day start on 12/31/2000...

gettin' jiggy wid' it --
smbure
 
With a command like this:

SELECT category, weekno, SUM(amount)
FROM <database>
WHERE category = 'downtime'
GROUP BY category, weekno
HAVING SUM(amount) >= 0

SQL Server does this summation for you.
br
Gerard
(-:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top