Solved

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

Posted on 2007-03-30
1
720 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Database Inventory 7 28
how to resize column length with primary ket 4 34
Creating a View from a CTE 15 46
Do not display comma when no last name 8 48
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

734 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