Solved

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

Posted on 2007-03-30
1
707 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Viewers will learn how the fundamental information of how to create a table.
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…

930 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

17 Experts available now in Live!

Get 1:1 Help Now