Datetime - problem with Time part

  • I am trying to use an Activex script in DTS to combine two strings into the a datetime field.

    eg: "2006/01/01" and "10:50:30"

    I can do the date part, using dateserial, but how do I get the time in ?

  • dim dt

    dim sdt

    dim stm

    sdt = "2006/01/01"

    stm = "10:50:30"

    dt = dateserial(cint(left(sdt, 4)) cint(mid(sdt, 6, 2)), cint(right(sdt,2))) + cdate (stm)

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Thanks Russel - you are a star !

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply