On 8/2/06, Brian Dumbledore <[EMAIL PROTECTED]> wrote:
> I am using MS-SQL, I couldn't get this to work..
>
> I tried, patindex,charindex, like combinations, none worked.
>
> I have directory paths in a table, given a starting path of a directory, I 
> want to get its first level elements.
>
> eg:
>
> table has
> warranty\a\1.jpg
> warranty\a
> warranty\a\2.jpg
> warranty\a22
> warranty\a-23
>
> I want to get warranty\a,warranty\a22,warranty\a-23
>
> I tried all combinations, it doesn't work (correctly). I actually get only 
> warranty\a, but don't get the other two (which makes me thing it is because 
> of the numbers in the string.. but doesn't make any sense). Please help
>

SELECT * FROM table WHERE CHARINDEX('\',thecolumn,CHARINDEX ('\',foo)+1) = 0

-- 
Jim Wright
Wright Business Solutions
[EMAIL PROTECTED]
919-417-2257

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248684
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to