Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 21st, 2003, 05:16 AM
vidapura vidapura is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 vidapura User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
select records that contain a question mark

Hi,
I'm trying to come up with a select statement in Access that will give me back all the rows that actually contain a question mark character.
For instance, some of the rows in my db contain strings like "What is your name? Bill" (without the quotes) and I want to just strip out the question out of any rows in which a question exists... so I thought I'd just do something like

Select * from survey where question1 like '*\\?*' ;

But this doesn't work... I hav tried tons of combinations... all I'm trying to do is escape the question mark...

Can anyone help?

Thanks
Vida

Reply With Quote
  #2  
Old November 21st, 2003, 05:07 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
As far as I know, Access uses the same wildcard notation as any other database.
Code:
SELECT * FROM foo WHERE name LIKE '%?%'
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old December 7th, 2003, 03:35 AM
Jim Lanham Jim Lanham is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 2 Jim Lanham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
According to a (Access 97) book I've been scanning through to solve a different problem it says:

To find values that end in a question mark use this:
Like "*[?]"

I hope this helps.

Jim

Reply With Quote
  #4  
Old December 8th, 2003, 04:08 AM
vidapura vidapura is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 vidapura User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Jim Lanham
According to a (Access 97) book I've been scanning through to solve a different problem it says:

To find values that end in a question mark use this:
Like "*[?]"



Oh yea!!
I suppose that makes sense eh? Access uses the square brackets for the range of chars....
Great,
Thanks Jim!

BTW for anyone who comes looking for info about this question in relation to an oracle database... [I'm using linked tables to an oracle 8 database just to confuse matters] .. in oracle 8 the question mark is not a wildcard character at all.... so to do an oracle query straight (using Toad or something like that) you can just use:

LIKE '%?%'

to identify records containing a question mark.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > select records that contain a question mark


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway