View Full Version : I need to loop through the months and call the sp each time per month.

04-11-2006, 06:43 PM

I have this function, but can't seem to loop it correctly to display the results.

Function fGetMemberSearchPageStats(iMemberId, iLogType, strTimePeriod, dtReqDate)
Dim rsLog, iResult
Set rsLog = Conn.Execute("spGetMemberProfileHits " & iMemberId & ", " & iLogType & ", '" & strTimePeriod & "', '" & dtReqDate & "' ")
If Not rsLog.EOF Then
iResult = rsLog.Fields("hit_count")
End If
Set rsLog = Nothing
fGetMemberSearchPageStats = iResult
End Function

so anyways, I want to loop through the months and show the results of the users search results....

'' sp Arguments - Member Number, Log Type, DatePeriod, Requested Date
iMonthCount = fGetMemberSearchPageStats(iMemberId, 1, "month", "04/01/06")


I want to pop them in to a table once its all said in done.

if iMonthCount = fGetMemberSearchPageStats(iMemberId, 1, "month", "01/01/06" Then <%=iMonthCount %> Else If iMonthCount = fGetMemberSearchPageStats(iMemberIf, 1, "month", " 02/01/06" then <%=iMonthCount %>

I know that logic is totally invalid, but what would make this more helpful for me?

I appreciate you help.

04-11-2006, 07:53 PM
Would it best to use a For Each...Next Statement?


04-12-2006, 04:30 PM
Sorry, I read through it and want to help, but just don't really understand what's going on.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum