CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Filtering for strings

Print topic Send  topic

Author Message
Bentspoon
Posted: 11/19/2003, 4:12 PM

Forgive me for I am new to code in general and completely new to CCS. I know that this is exceedingly simple but I cannot get it to work.

I based a CCS grid on a join query in my database. That query had a criteria on the column [Name] so that records with "transfer*" are filtered out. When CCS built the grid, it did not retrieve the criteria parameters. Therefore, I went into the query builder and set where conditions. My goal was to create a "Not-Like" situation for anything beginning with "Transfer". I did not see term "string" in the selections for the Parameter Source type. Therefore I used the term "expression" and tested the query - it worked. However, when I try to publish the live page it doesn't work unless I remove this "where" parameter.

So the question is: how can I use where parameters to filter out data based on a string? How can I eliminate any records that start with "Transfer" in the [Name} field?

It feels stupid asking this question. It seems that it should be obvious.
Tony
ryan
Posted: 11/19/2003, 10:22 PM

This is taken from Northwind on SQL Server Database

SELECT *
FROM Employees
WHERE (Title NOT LIKE 'Sales%')

This filters out words starting with 'Sales%'

Therefore you should use WHERE parameter in EXPRESSION and enter this

Title NOT LIKE 'Sales%'

Or In your case

Name NOT LIKE 'Transfer%'

Or when using Access 97/2000

Name NOT LIKE 'Transfer*'

Kindly try and regards Tony
Bentspoon
Posted: 11/20/2003, 9:52 AM

Thanks for the reply Tony. I appreciate the help. Here is the entire code for the query (note the last line):

SELECT [EQ ID], DESCRIPTIO, MAKE, MODEL, FLUKE_ID, ASSET_NO, SERIAL_NO, DATE_OUT, Name, DEPT
FROM qryUseNowDetail
WHERE DESCRIPTIO LIKE '%{s_DESCRIPTIO}%'
AND MAKE LIKE '%{s_MAKE}%'
AND MODEL LIKE '%{s_MODEL}%'
AND FLUKE_ID LIKE '%{s_FLUKE_ID}%'
AND ASSET_NO LIKE '%{s_ASSET_NO}%'
AND SERIAL_NO LIKE '%{s_SERIAL_NO}%'
AND Name LIKE '%{s_Name}%'
AND DEPT LIKE '%{s_DEPT}%'
AND Name NOT LIKE 'Transfer%'

Now when I run a test of the query, the data looks fine with no "transfers". However, If I try to publish the CCS page, it chokes and I get "Page cannot be displayed" error. If I remove the last line (the transfer parameter) CCS publishes and reads the page just fine - of course with all the offending "transfers" included.

I do not understand what the problem is. This shouldn't be so hard to simply filter for a string.

Bentspoon

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.