im using classic asp and sql server. my if statement checks if there is a price within 5 places [price_band_1 to 5] and then if any has a value shoud output 'I HAVE DATA' but it doesnt.. can anyone help?
i dont get any errors but Instead 'I HAVE NO DATA' is output on the page. this is clearly wrong if you look at my sample data from sql server
sample data
sample data
thanks in advance
Omar.
i dont get any errors but Instead 'I HAVE NO DATA' is output on the page. this is clearly wrong if you look at my sample data from sql server
Code:
<% 'CHECK FOR PRICES DIM objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=SQLOLEDB;Data Source=HIDDEN;" & _ "Initial Catalog=HIDDEN;User ID=HIDDEN;Password=HIDDEN" objConn.Open DIM SQL SQL = "SELECT * FROM TESTCA_Specials WHERE ID IN (10, 14, 18)" DIM objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open SQL, objConn 'check to see if there are any prices If (NOT IsNull(objRS("Price_Band_1"))) OR (NOT IsNull(objRS("Price_Band_2"))) OR _ (NOT IsNull(objRS("Price_Band_3"))) OR (NOT IsNull(objRS("Price_Band_4"))) OR _ (NOT IsNull(objRS("Price_Band_5"))) Then Response.Write "I HAVE DATA" Else Response.Write "I HAVE NO DATA" End IF objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %>
Code:
ID Flight_Route Price_Band_1 Month_Band_1 Date_Band_1 Price_Band_2 Month_Band_2 Date_Band_2 Price_Band_3 Month_Band_3 Date_Band_3 Price_Band_4 Month_Band_4 Date_Band_4 Price_Band_5 Month_Band_5 Date_Band_5 10 GATWICK to MONTREAL NULL Nov NO FLIGHT NULL Dec NO FLIGHT NULL Jan NO FLIGHT NULL Apr NO FLIGHT NULL May NO FLIGHT 14 GATWICK to VANCOUVER 500 Nov 25 300 Dec 9 50 Jan 27 250 Apr 7, 14, 28 NULL May NO FLIGHT 18 GLASGOW to CALGARY NULL Nov NO FLIGHT NULL Dec NO FLIGHT NULL Jan NO FLIGHT NULL Apr NO FLIGHT NULL May NO FLIGHT
thanks in advance
Omar.
Comment