1. Registered User
Join Date
Nov 2004
Posts
2

hmm ok here is an outline:

I have a view which is a combination of TblHorses and TblOwners has fields:

Form from Horses
StableHands from owners

ok goes through all the horses and creates a number either 0,1,2

based on the formula

Round((int(RSFormUpd("StableHands"))/22) + (rnd * 2),0)

then if the random number = 0 the Form goes down 1 unless is already 1 then stays the same

if = 1 then stays same

if = 2 then form goes up 1 unless it is already 5 then it stays the same

then this is how i coded in asp as i can do asp/vb programming lol but T-SQL is a mystery:

Randomize()

RSFormUpd.open "Select * From ViewWeeklyFormUpdate", Conn, 3, 3
Do While Not RSFormUpd.EOF

UpdForm = Round((int(RSFormUpd("StableHands"))/22) + (rnd * 2),0)

If UpdForm = 0 Then
If int(RSFormUpd("Form")) - 1 = 0 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
Else
RSFormUpd("Form") = int(RSFormUpd("Form")) - 1
End If
End If

If UpdForm = 1 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
End If

If UpdForm = 2 Then
If int(RSFormUpd("Form")) + 1 = 6 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
Else
RSFormUpd("Form") = int(RSFormUpd("Form")) + 1
End If
End If

Response.write RSFormUpd("Form") & " "

RSFormUpd.update

RSFormUpd.movenext
Loop

RSFormUpd.close
Set RSFormUpd = Nothing

Dagaz

2. Registered User
Join Date
May 2003
Location
UK
Posts
220
so what is the problem please?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•