Hi all,
I am trying to create a way to do a simple search
Here is my Query:
"SELECT [Rods].* FROM [Rods] WHERE (([Rods].[CrankType] = @CrankType) AND ([Rods]." & _
"[Action] = @Action) AND ([Rods].[Material] = @Material) AND ([Rods].[Application" & _
"] = @Application) AND ([Rods].[Power] = @Power))"
All of the variables are generated from DDlists. ex:
@Power = MyVariable & MyVariable=MyDDL.selectedvalue.
Since this is a search, not all of the DDLs have searchable data in them all of the time. The database that I am querying is full of numbers and if the DDL has not been changed the selected value is 0. None of the fields in database that I am querying have zeros in them.
Finally the question: How can I make a query using only the changed DDLs without creating 30 if:then:else statements to Account for all of the scenarios?
I am pretty new to SQL. Asp.Net Web Matrix created the code for me but I understand about the @ Variables
Sorry if the post is wordy, I just want to give all of the information
Thank you
Rob
I am trying to create a way to do a simple search
Here is my Query:
"SELECT [Rods].* FROM [Rods] WHERE (([Rods].[CrankType] = @CrankType) AND ([Rods]." & _
"[Action] = @Action) AND ([Rods].[Material] = @Material) AND ([Rods].[Application" & _
"] = @Application) AND ([Rods].[Power] = @Power))"
All of the variables are generated from DDlists. ex:
@Power = MyVariable & MyVariable=MyDDL.selectedvalue.
Since this is a search, not all of the DDLs have searchable data in them all of the time. The database that I am querying is full of numbers and if the DDL has not been changed the selected value is 0. None of the fields in database that I am querying have zeros in them.
Finally the question: How can I make a query using only the changed DDLs without creating 30 if:then:else statements to Account for all of the scenarios?
I am pretty new to SQL. Asp.Net Web Matrix created the code for me but I understand about the @ Variables
Sorry if the post is wordy, I just want to give all of the information
Thank you
Rob