Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    St. Louis
    Posts
    1

    Unanswered: Concantenating Dates

    I am transferring data between DB's. One has DATE and TIME as two individual fields. I need to concantenate them into a single DATETIME field. I am sure the solution is simple but I can't figure it out.

    Any advice?
    Thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    If you select from your time column, you should see that it's date is set to January 1st, 1900, like this:
    1900-01-01 14:59:27.293

    Your date column should show a date as of midnight like this:
    2003-07-14 00:00:00.000

    If this is the case, you can just add these value together to concatenate them:
    select @Yourdate + @Yourtime

    If this is not the case, you will need to concatenate them as formatted strings and then cast or convert the result to a datetime value.

    blindman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •