Solved

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

Posted on 2007-03-30
1
704 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now