This topic is locked

Search Function query

5/1/2009 7:17:41 AM
ASPRunnerPro General questions
M
mark.field author

Hi,
ASPRunnerPro 5, 1, 0, 318

SQL2005
I have a table that is edited via an ASPRunner generated page. The table is a template that is used to generate records for another table via a Stored Procedure / SQL Job.
One field (TeamName) is updated by a look up table using Link Field = Team Code with Display Field and Order By set to Team Name. I wanted the Team Name to get updated with the Team Code (in case someone decides to rename their team) and it does this correctly. E.g. Look up Table Team Code = 1, Team Name = Sales and the destination table gets set to Team Name = 1.
When the data is displayed on the List Page it shows the Team Name e.g. Sales rather than the Code which to be honest is quite nice and user friendly.
The issue I have is when using the search function, if you enter 'Sales' no records are displayed. However, if you enter '1' all of the required records are displayed. The problem is the users won't know what their 'number' is so need to be able to search on the text e.g. 'Sales'.
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11718&image=1&table=forumtopics' class='bbc_emoticon' alt=':unsure:' />
Comments gratefully received.

Sergey Kornilov admin 5/1/2009

You can only search for data that is in the SQL query.
This means you need to create a JOIN SQL query joining fields from lookup tables. You don't need to display joined field anywhere, just make sure they are searchable ('Choose fields' screen).