Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDownList to Select True and False values from Bit field

Status
Not open for further replies.

monkeymagic2222

Technical User
May 13, 2002
78
0
0
GB
Hi,

I have an sql database table containing contract information. In it there is a Bit column called "Terminated" which is either True or False. On my aspx page I have a dropdown which has the values Terminated and Current which will send either a true or false value to the database.

I would like to add an extra item to this dropdown to return All (both true and false) values but am unsure how I can do it as its not possible to send a wildcard "%" character to a Bit field.

Thanks in advance.
 
Send in a text value to a stored procedure in a parameter.
@Terminated varchar(5)

From the dropdown send in either "TRUE", "FALSE", or "BOTH"
Then in the SP use an if statment to evaluate the paramete

If @Termnated = "TRUE"
Select cols
From table
Where Terminated = 1

If @Termnated = "FALSE"
Select cols
From table
Where Terminated = 0

If @Termnated = "BOTH"
Select cols
From table
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top