Solved

CharIndex is not acceptable in dataview, what is the equivalent?

Posted on 2007-03-30
1
716 Views
Last Modified: 2008-01-09
Hi,

I have a filter in a dataview as:
dv.RowFilter = (CHARINDEX (fromAct, 'AASC ST LOUIS') > 0 OR CHARINDEX (toAct, 'AASC ST LOUIS') > 0) AND (CHARINDEX (fromAct, 'AAI MD') > 0 OR CHARINDEX (toAct, 'AAI MD') > 0) AND UpdDate >= 1/1/2000 AND UpdDate <= 3/30/2007

whereas dv is a dataview

At run time, I got "the expression contains undefined function call CHARINDEX()." error.

What is the equivalent of charindex for dataview rowfilter?

Many thanks,
Diane Ha
0
Comment
Question by:tnova1
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 18824421
There's not a direct equivalent, but you can use LIKE:

(fromAct LIKE '%AASC ST LOUIS%' OR toAct LIKE '%AASC ST LOUIS%')
AND (fromAct LIKE '%AAI MD%' OR toAct LIKE '%AAI MD%')
AND UpdDate >= 1/1/2000 AND UpdDate <= 3/30/2007
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question