[thelist] Impact of LIKE in sql
msomers at uism.bu.edu
msomers at uism.bu.edu
Thu Dec 14 14:16:12 CST 2000
To include blank fields in a cross table search use the expression "like" :
Forms![Search Results]![List22].RowSource = "SELECT DISTINCTROW
[Listings].[bldg_code], [Listings].[bldg_strt], [Listings].[bldg_num_a],
[Listings].[bldg_num_b] FROM [Listings], [Expends] where [Expends].[bldg_code] =
[Listings].[bldg_code] AND [Listings].[yr_acq] like '" & fy2 & "' AND
[Expends].[Bldg_div] like '" & div2 & "' AND [Expends].[group_id]like '" &
group2 & "' AND [Expends].[bldg_cat] like '" & cat2 & "' ORDER BY
[Listings].[bldg_strt], [Listings].[bldg_num_a], [Listings].[bldg_num_b];"
Where the variables such as cat2 are values base on list box selections..if the
listindex = "-1" then cat2 is an "*" otherwise its the listindex... Using
"like" I'm able to match all the fields that are "like" "*" and therefore
include blank fields in my search..
More information about the thelist
mailing list