I have the following sql query that returns the DateTime-formatted information in Month format like December or Novermber:
SELECT COUNT(DISTINCT dbo.UserQuiz.QuizID) AS [Total Number of Taken Quizzes], dbo.Divisions.DivisionName, DATENAME(Month, dbo.UserQuiz.DateTimeComplete)
AS Month
FROM dbo.UserQuiz INNER JOIN
dbo.Quiz ON dbo.UserQuiz.QuizID = dbo.Quiz.QuizID INNER JOIN
dbo.employee ON dbo.UserQuiz.Username = dbo.employee.Username INNER JOIN
dbo.Divisions ON dbo.employee.DivisionCode = dbo.Divisions.SapCode
GROUP BY dbo.Divisions.DivisionName, DATENAME(Month, dbo.UserQuiz.DateTimeComplete)
I want just to get the date in whatever format such as: mm-dd-yyyy. How to do that?
1 Answer