MyTable:
id int
Date1 DateTime
Date2 DateTime
How can I set the time of Date2 to be the same as Date1 without affecting the date of Date2?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update
Date2with only the difference in days between the two dates.This will preserve the date portion of
Date2.UPDATE: This method essentially reconstructs
Date2by usingDate1as a reference and only adding the difference in days betweenDate1andDate2– preserving the TimeStamp fromDate1.