|
-
Jul 11th, 2009, 02:19 AM
#1
Thread Starter
New Member
SQL problem
so basically ive got the following piece of SQL:
"SELECT Scales.[Scale Name], Scales.[Root Note], Scales.Notes from Scales where (InStr(Scales.Notes, Text1.Text)"
where text1 is a textbox on the form, yet it doesnt seem to register it, is there some special way to put text1.text into the InStr function?
-
Jul 11th, 2009, 03:42 AM
#2
Addicted Member
Re: SQL problem
I don't believe an InStr function exists in SQL.
If you're looking for the value of Text1.Text in Scales.Notes, why not try:
"SELECT Scales.[Scale Name], Scales.[Root Note], Scales.Notes from Scales where Scales.Notes like '%" & Text1.Text & "%'"
?
-
Jul 11th, 2009, 04:50 AM
#3
Thread Starter
New Member
Re: SQL problem
 Originally Posted by dev.rogee
I don't believe an InStr function exists in SQL.
If you're looking for the value of Text1.Text in Scales.Notes, why not try:
"SELECT Scales.[Scale Name], Scales.[Root Note], Scales.Notes from Scales where Scales.Notes like '%" & Text1.Text & "%'"
?

aha it works a beauty! thankyou very much!
may i ask what the % denotes?
-
Jul 11th, 2009, 07:36 AM
#4
Re: SQL problem
 Originally Posted by CrownOfHorns
...may i ask what the % denotes?
The % symbol is a wild card. Similar to DOS' * symbol.
-
Jul 12th, 2009, 04:59 AM
#5
Thread Starter
New Member
Re: SQL problem
 Originally Posted by LaVolpe
The % symbol is a wild card. Similar to DOS' * symbol.
ahh that makes sense, i was using * instead of %
cool thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|