[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

elp with filtering data in table

Posted on 2014-08-05
5
Medium Priority
?
216 Views
Last Modified: 2014-08-05
Hi,

How do you modify the code below to filter data if RIC = 'N/A' or is null, code below does not work.

 Dim SearchCriteria As String = "RIC <> ' '" 'or RIC <> 'N/A'"
            Dim FilteredDTA As DataTable
            Dim DVA As New DataView(dtsetLinkAOP6A.Tables(0), SearchCriteria, Nothing, DataViewRowState.CurrentRows)

Open in new window


Thanks,

Victor
0
Comment
Question by:vcharles
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 40241018
Try this:
Dim SearchCriteria As String = "ISNULL(RIC, 'N/A') = 'N/A'"

Hope that helps.
0
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 40241024
Sorry, I think you try to get the records where RIC is not null nor 'N/A'. In that case:

Dim SearchCriteria As String = "ISNULL(RIC, 'N/A') <> 'N/A'"
0
 

Author Comment

by:vcharles
ID: 40241174
Hi,

I tried the code but I still get records with blank values.

Victor
0
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 2000 total points
ID: 40241457
The blank values are blankspaces or are null?

Try this:
Dim SearchCriteria As String = "(ISNULL(RIC, 'N/A') <> 'N/A') AND (LEN(LTRIM(RTRIM(ISNULL(RIC, 'N/A')))) <> 0)"
0
 

Author Closing Comment

by:vcharles
ID: 40241478
Thank You.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

873 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