I tried the CONVERT(TIME,sample_datetime), but my software does not recognize TIME as a type.
How do I take sample datetime and extract the time from it in one variable and the day of the week from it in another variable?
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.
DATEPART or DATENAME with DW will work for the day of the week depending on which format you need
You can convert the datetime to a varchar with specific formatting to get just the time
2008 has a TIME datatype, but it doesn’t sound like you’re running that