select *
>From tablename
where patindex('%\%\%',dir) = 0
And patindex('%\%',dir) > 0


-----Original Message-----
From: Brian Dumbledore [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 02, 2006 4:31 PM
To: CF-Talk
Subject: sql question.

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

Thanks for your time.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:248685
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to