15726 Wildcard search for single character only - Page 2
Sign Up |  Live StatsLive Stats    Articles 37,342| Comments 177,335| Members 19,420, Newest Talia| Online 549
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags
Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Wildcard search for single character only

Wildcard search for single character only

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Merge data into single Word doc from single Access record CW Information Technology 3 28-Jul-2006 08:35 AM
Wildcard in an IN? Merlin Information Technology 1 28-Jul-2006 08:35 AM
Help: Wildcard Charaters bbddvv Information Technology 0 28-Jul-2006 08:27 AM
Wildcard in query Steve Y Information Technology 3 28-Jul-2006 08:21 AM
what is the purpose of the 'wildcard' in data base queries Boyo Information Technology 2 28-Jul-2006 08:00 AM


Tags
wildcard, search, single, character
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #10 (permalink)  
Old 28-Jul-2006, 08:25 AM
James A. Fortune's Avatar James A. Fortune
Guest
 
Posts: n/a
   
   
Re: Wildcard search for single character only

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Jamie Collins wrote:
> sdg8481 wrote:
>
>>i want it to
>>contain a W and no other letter (apart from more W's or :'s)

>
>
> Try:
>
> my_col NOT LIKE '*[!W:]*'
>
> There is no need to explicitly handle null values because of the
> inherent behaviour of NULL values in SQL DDL i.e. an 'unknown' value
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11913-wildcard-search-for-single-character-only.html
> cannot be known to fail a validation rule, therefore it is allowed to
> pass.
>
> While we are on the subject of wildcard characters, you should
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11913
> explicitly handle both 'ANSI' and 'non-ANSI' flavours of (multi-)
> character wildcard, otherwise you validation rule may be thwarted
> simply by switching from DAO to ADO e.g.
>
> my_col NOT LIKE '%[!W:]%' AND my_col NOT LIKE '*[!W:]*'
>
> Jamie.
>
> --
>


Jamie,

I think your basic idea is great, even elegant, but the second example I
tried -- "::" -- didn't work correctly.

James A. Fortune
MPAPoster@FortuneJames.com


Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #11 (permalink)  
Old 28-Jul-2006, 08:25 AM
Jamie Collins's Avatar Jamie Collins
Guest
 
Posts: n/a
   
   
Re: Wildcard search for single character only


James A. Fortune wrote:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11913
> > Try:
> >
> > my_col NOT LIKE '*[!W:]*'
> >
> > you should
> > explicitly handle both 'ANSI' and 'non-ANSI' flavours of (multi-)
> > character wildcard
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11913
> >
> > my_col NOT LIKE '%[!W:]%' AND my_col NOT LIKE '*[!W:]*'

>
> I think your basic idea is great, even elegant, but the second example I
> tried -- "::" -- didn't work correctly.


I didn't use "::" in my second example.

Jamie.

--

Reply With Quote
  #12 (permalink)  
Old 28-Jul-2006, 08:27 AM
Phillip Windell's Avatar Phillip Windell
Guest
 
Posts: n/a
   
   
Re: Wildcard search for single character only

  Donate Today!  
Perhaps the best question would be "Why do you have such a situation that
would require this kind of query?" Maybe you are approaching it wrong to
start with, or maybe the database design needs altered as to not created
such a situation.

I believe that, generally speaking, if something is very difficult and messy
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11913
to do,...it is probably being done wrong to start with.

--
Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com


"sdg8481" wrote in message
news:497AB029-C21A-4FE1-A2F3-CDB694286B89@microsoft.com...
> Thanks James, but i can't appear to get this to work
>
> "James A. Fortune" wrote:
>
> > sdg8481 wrote:
> > > Hi,
> > >
> > > I have a field wihich contain a variety of letters, examples below;
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11913
> > >
> > > W:YMW
> > > :W
> > > W:WWW
> > > Y:Y9
> > > 9:W9
> > > W:W
> > > Y:YW
> > >
> > > ETC....
> > >
> > > i need to pick out only those rows that have a W, no matter how many

W's,
> > > but must have no other letter, but can have the : character. How can

this be
> > > include into a IF statement, like below
> > >
> > > If([Column Header] = ???? , "E", "I"
> > >
> > > Hope you can help Thanks

> >
> > If you are using A2K or greater, try something like (untested):
> >
> > If InStr(Nz(MyFieldOrVariable), ""), "W", 1) > 0 And
> > Len(Replace(Replace(Nz(MyFieldOrVariable, ""), ":", "W"), "W", "")) = 0
> > Then ...
> >
> > The field or variable must contain a "W" and then after changing ":"'s
> > to "W"'s and changing any resulting "W"'s to empty strings there can be
> > nothing left. I think Ofer read your post a little too quickly and
> > missed the part about no other letter.
> >
> > James A. Fortune
> > MPAPoster@FortuneJames.com
> >



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Woolwich Killing: The...
Today 01:01 AM
5 Replies, 95 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 00:36 AM
182 Replies, 4,573 Views
Rochester Gurdwara...
Today 00:24 AM
1 Replies, 24 Views
How does Sikhi help you...
Yesterday 23:30 PM
38 Replies, 1,060 Views
Panjabi Alphabet Resource
Yesterday 23:15 PM
12 Replies, 6,548 Views
Transgenderism ... Right...
Yesterday 22:55 PM
30 Replies, 1,340 Views
Biography of a Scholar:...
Yesterday 22:53 PM
1 Replies, 37 Views
Dusting The Web
Yesterday 22:25 PM
0 Replies, 23 Views
How Pure the Tongue? New...
Yesterday 21:29 PM
0 Replies, 39 Views
Stockholm riots throw...
Yesterday 21:14 PM
1 Replies, 27 Views
Biography of a Scholar:...
Yesterday 18:59 PM
2 Replies, 164 Views
Request for assistance...
By Ishna
Yesterday 18:46 PM
11 Replies, 158 Views
Occultism - Rejection in...
Yesterday 08:44 AM
62 Replies, 2,688 Views
‘Bigoted’ Facebook...
Yesterday 08:32 AM
1 Replies, 78 Views
Australia mulls allowing...
Yesterday 07:30 AM
0 Replies, 65 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 01:13 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.42241 seconds with 32 queries
0