Home All Groups Group Topic Archive Search About

how to fetch the concatinated column

Author
12 Oct 2005 9:44 AM
raja
hi

in my database there is a coulm called snippetlog which contains data
like asdaf/qrrqr/asgjg.txt i want to fetch the last one ( asgjg.txt) how
its possible to fetch that in a column pls reply

raja

*** Sent via Developersdex http://www.developersdex.com ***

Author
12 Oct 2005 12:07 PM
Norm Cook
Some simple string manipulation should work:

Public Function FileTitle(ByVal FilePath As String) As String
Dim p As Long
p = InStrRev(FilePath, "\")
If p Then
  FileTitle = Mid$(FilePath, p + 1)
Else
  FileTitle = FilePath
End If
End Function

Show quoteHide quote
<raja> wrote in message news:uyKLJGxzFHA.2792@tk2msftngp13.phx.gbl...
>
> hi
>
> in my database there is a coulm called snippetlog which contains data
> like asdaf/qrrqr/asgjg.txt i want to fetch the last one ( asgjg.txt) how
> its possible to fetch that in a column pls reply
>
> raja
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
12 Oct 2005 12:09 PM
Phill. W
<raja> wrote in message news:uyKLJGxzFHA.2792@tk2msftngp13.phx.gbl...

> in my database there is a coulm called snippetlog which contains
> data like asdaf/qrrqr/asgjg.txt i want to fetch the last one ( asgjg.txt)

To extract it directly in SQL would depend /entirely/ on which
database you're using, which you /didn't/ actually mention.

However, I have to say that databases are very good at retrieving
bits of data and putting them /together/, but they're pretty useless at
pulling them apart again.  I would strongly suggest that if you need
to be able to treat file "path" and file "name" as two different things,
you should store them in two, separate columns - you can always
create a view on top of your table that puts them back together
again.

HTH,
    Phill  W.