Join two tables

  • need help to write a query to pull the below data

    difference between

    RIinvitationCreatedDate in RInvitation table

    and UsertRegistrationCompletedDate from User table

    and Join these two tables with RInvitation.RInvitationLoginID on User.UserID

    Thank you

  • What have you tried so far?

    John

  • select u.UserID, u.UsertRegistrationCompletedDate - r.RIinvitationCreatedDate

    from RInvitation r

    join User u

    on u.UserID = r.RInvitationLoginID

    BUT THE OUTPUT IS

    101900-01-01 05:00:17.300

    111900-01-01 00:00:58.597

    121900-01-01 00:07:58.157

    131900-01-01 00:04:01.503

    201899-12-31 23:41:00.080

    211899-12-31 23:41:39.953

    231899-12-31 23:15:03.610

    291899-12-31 21:27:39.953

    I need the difference time between RIinvitationCreatedDate in RInvitation table

    and UsertRegistrationCompletedDate from User table. Thanks!

  • When you say "difference time", what do you mean - the number of minutes, the number of hours, or something else? I recommend that you look at the DATEDIFF function.

    John

  • Thank you.

    I am looking for difference in minutes

  • OK. Like I said, look at DATEDIFF.

    John

Viewing 6 posts - 1 through 5 (of 5 total)

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