SELECT [MI_ROUTE000].[MI_ROUTE000_ROUTE_ID_C] "Route Id", [MI_ROUTE000].[MC_FILTER_CODE_C] "Filter Code", [MI_ROUTE000].ENTY_KEY "ROUTE_KEY"
FROM [MI_ROUTE000]
WHERE ([MI_ROUTE000].[MI_ROUTE000_ROUTE_ID_C] = (? :s :caption='Route ID' :id=route) AND [MI_ROUTE000].[MC_FILTER_CODE_C] = (? :s :caption='Filter Code' :id=filtercode))
Dim iPos As Integer
Dim strRoute as String=AutoTrim(src("Route")).ToString
if not ISDBNull(strRoute) then
'Drop Suffix (If exists)
iPos = strRoute.LastIndexOf(" ")
If iPos > 0 Then
strRoute = strRoute.Substring(0, iPos).Trim()
End If
iPos = strRoute.LastIndexOf("(")
If iPos > 0 Then
strRoute = strRoute.Substring(0, iPos).Trim()
End If
SRC_ROUNDS_QUERY_ROUTEKEY_LookupKeys("route")=strRoute
SRC_ROUNDS_QUERY_ROUTEKEY_LookupKeys("filtercode")= AutoTrim(src("Filter_Code"))
end if