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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange parameter results... 2

Status
Not open for further replies.

DTJeff

Programmer
Dec 9, 2003
37
GB
Hi,

I'm building a report using parameters (passed to the report by VB.Net app) and I am getting odd results.

This is my selection Formula:
Code:
({TblAssets.Desc1} = "rexel" or {TblAssets.Desc1} = "hp")
and
({TblLocations.Level5} like{?Site});

if I pass say 'Newcastle' as ?site, then it works fine. However, if I pass 'Newcastle ' (trailing space), this doesn't work - even though the entry in the SQL table definatly has a trailing space in there.

If I pass ?Site as 'New*' then it works fine as well.

Any ideas as this is driving me crazy trying to work out what is happening.

Cheers

Jeff.
 
You need to add the wildcard to your selection formula
i.e.

Code:
CODE
({TblAssets.Desc1} = "rexel" or {TblAssets.Desc1} = "hp")
and
({TblLocations.Level5} like{?Site}) & '*'

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
you might try

{TblAssets.Desc1} in ["rexel","hp"]
and
{TblLocations.Level5} like trim({?Site});


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Hi,

Thanks for the help. I found another post on here that was unrelated but gave me inspiration :).

I've changed the formula to this:

Code:
({TblAssets.Desc1} = "rexel" or {TblAssets.Desc1} = "hp")
and
(if {?Site} = "" then {TblLocations.Level5} like "*" else {TblLocations.Level5}={?Site})

This seems to work, and will only give me exact matches, rather than anyhting that might only partially match the paramter.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top