Click to See Complete Forum and Search --> : If Else Statement


vb89
09-24-2008, 04:39 PM
(This is a classic asp page pulling data from an oracle database) I basically just want the first if statement to overwrite the second statement in the case that the criteria of the first if statement is met. So basically if the league_id value is 0 and the team id value is 0 I would like the tSQL function to display main.cfb_division_id = 1" and - Division: I-A"...any help on how to edit my code to do that would be great...thanks



If iLeagueID = "0" and iTeamID = "0" then
tSQL = tSQL & " AND main.cfb_division_id = 1"
tPlayerFilter = tPlayerFilter & " - Division: I-A"
End If

If iLeagueID = "0" Then
tSQL = tSQL
tPlayerFilter = tPlayerFilter
ElseIf iLeagueID = "2" Then
tSQL = tSQL & " AND main.cfb_division_id = 2"
tPlayerFilter = tPlayerFilter & " - Division: I-AA"
ElseIf iLeagueID = "9" Then
tSQL = tSQL & " AND main.cfb_division_id = 9"
tPlayerFilter = tPlayerFilter & " - Division: I-A + I-AA"
ElseIf iLeagueID = "1" Then
tSQL = tSQL & " AND main.cfb_division_id = 1"
tPlayerFilter = tPlayerFilter & " - Division: I-A"
End If

tonwinemaker
09-26-2008, 03:57 AM
mean something like this????

If iLeagueID = "0" Then
ìf TeamId=0 then
tSQL & " AND main.cfb_division_id = 1"
tPlayerFilter = tPlayerFilter & " - Division: I-A"
end if
ElseIf iLeagueID = "1" Then
tSQL = tSQL & " AND main.cfb_division_id = 1"
tPlayerFilter = tPlayerFilter & " - Division: I-A"
ElseIf iLeagueID = "2" Then
tSQL = tSQL & " AND main.cfb_division_id = 2"
tPlayerFilter = tPlayerFilter & " - Division: I-AA"
ElseIf iLeagueID = "9" Then
tSQL = tSQL & " AND main.cfb_division_id = 9"
tPlayerFilter = tPlayerFilter & " - Division: I-A + I-AA"
End If