Solved

using ntext fields in filter criteria

Posted on 2004-03-21
4
296 Views
Last Modified: 2008-01-09
I use VB6 and Sql server, when i used this code :-

rscabasho.Filter = "(jawaab is null and kusocota ='" & st & "')  or (katimi='" & st & "' and jawaab<>'') "

Jawaab is ntext field, if i use any other field works well, as well if i use the field jawaab with = operator it works , but this can't be used , since  it could be a NULL value.


Then I encountered this message:-
3001/ argoments are of the wrog type, are out of the acceptable range , or are inconflict with one another

pls i need your suggestions.
Thanks.

M. roble
0
Comment
Question by:rooble
4 Comments
 
LVL 7

Expert Comment

by:mquiroz
ID: 10644726
maybe something like this:

rscabasho.Filter = "(jawaab is null and kusocota ='" & st & "')  or (katimi='" & st & "' and jawaab<>'') or  (katimi='" & st & "' and jawaab is not null)  "
0
 
LVL 13

Accepted Solution

by:
danblake earned 125 total points
ID: 10648392
You cannot perform a = '' or <> for ntext fields.

You would need to patern search for values using:
PATINDEX
Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.

Syntax
PATINDEX ( '%pattern%' , expression )

or alternativly the charindex string search :
The CHARINDEX and PATINDEX functions return the starting position of a pattern you specify. PATINDEX can use wildcard characters while CHARINDEX cannot.

From BOL.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sample Mysql database DATA needed 3 46
xBase++ 6 68
one-way data "masking" MD5 sql 26 97
MySQL ERROR 1045 (28000) 2 39
I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

15 Experts available now in Live!

Get 1:1 Help Now