User Profile

Collapse

Profile Sidebar

Collapse
tubeysocks
tubeysocks
Last Activity: May 9 '14, 10:31 PM
Joined: Apr 30 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tubeysocks
    replied to Extract min timestamp from string
    Thank you everyone for your help!

    I ended up using this to extract and convert the minimum time from a string:

    Code:
    SELECT CONVERT(datetime, REPLACE(LEFT(RIGHT(hdresp, PATINDEX('%(**%', REVERSE(hdresp)) - 1), 21), 'at ', ''))
    from tblhdmain
    where hdindex = 211458
    Which gave me the result:

    2014-04-02 15:17:00.000
    See more | Go to post

    Leave a comment:


  • tubeysocks
    started a topic Extract min timestamp from string

    Extract min timestamp from string

    Hello all,

    I am trying to query the minimum datetime from a column that is stored as nvarchar(max). There a a few tricky things with this query (at least for me)

    - There is more than just the date being stored within each record.

    -The position of the datetime is relative- although it does always appear in the format '**(DD-MM-YY at HH:MM PM'

    -There are multiple datetimes stored in each...
    See more | Go to post
No activity results to display
Show More
Working...