![]() |
|
|
#1 |
|
Newbie
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
![]() OS:
|
SQL question
I need some help. I have an asp .net page that has 6 text boxes that allow people to search. They can enter data in one or more of the text boxes for the search. The problem is that the database has nulls and the search does not retrieve those records with null values. My sql code is as follows:
Select FieldA, FieldB, FieldC, FieldD, FieldE, FieldF From TableA Where FieldA Like '%' + @FieldA + '%' And FieldB Like '%' + @FieldB + '%' AND FieldC Like '%' + @FieldC + '%' AND FieldD Like '%' + @FieldD + '%' AND FieldE Like '%' + @FieldE + '%' AND FieldF Like '%' + @FieldF + '%' The @fields are then assigned to the text box values and assigned to '%%' if blank. Any suggestions would be appreciated! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |