Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL to pull data from Access

Status
Not open for further replies.

proteome

Technical User
May 14, 2003
115
US
I am trying to determine if a certain row within a column contains a character more than once, if it does bypass it and only pull the row that contains only one character.

EX.

this would be pulled
KRW#TIL

this would not be pulled
TR#SYELYY#RRL

I would like to usin this in an SQL string so that I can create a query in Access so that I only pull out data that say contains only one #. I have created quesries similair to this in the past using instr() but I do not know how to have the program look for another occurance. Any help would be greatly appreciated.
 
Not sure about SQL but using the instr function:

select case InStr(InStr(YourText, "#") + 1, YourText, "#")
case 0
'there is 1 or less instances
case else
' there is more than 1 instance
end select

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
For a way to pull Access data using Excel, see this thread thread707-642379!

Then you can use the Excel functions in your SQL queries!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top