sql query for string search

abyss

Board Regular
Joined
Mar 24, 2004
Messages
68
can any1 help me solving this nebbie problem?

i have a column of 'text' variables and i need find all lines which contain variable string value, for example "2004" or smth like that...

i guess it's smth like this?:

SELECT N.id, N.description
FROM N
WHERE N.description [contains a word ( StrICmp :) )] variable_string;

yeah.... ..... :rolleyes:
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Just goto the query designer and enter *2004* as the criteria for the field you wish to search.

This would find/match all strings containing *2004*.

If you want to see what the SQL is just goto View>SQL View
 
Upvote 0
but next time the search string may be "2000" or "Special edition"....

i've found a function [ALIKE] that does StrICmp, but as a parameter I pass "2004":

..where N.description Alike "2004"....

how to pass that 2004 from a comboBox ?
 
Upvote 0
Found by myself.....

source if some1 needs...

SELECT [cdz].[nr], [cdz].[serial], [cdz].[cd descr]
FROM cdz
WHERE [cdz].[cd descr] ALike '%'+[search for string]+'%'
ORDER BY [nr];

:LOL:
 
Upvote 0
Can you explain fully what you are trying to acheive?
 
Upvote 0

Forum statistics

Threads
1,221,777
Messages
6,161,871
Members
451,727
Latest member
tyedye4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top