|
I am a New ASP.NET Developer and I am trying to develop a simple suggestion box system. I have the following part of my database desing:
(The first attribute is the primary key in each table and the attribute (submittedDate) is of DateTime data type) Now, I need to develop a table that shows suggestions for the last three months. I already developed a query that shows the Employee Name, Username, Division, Suggestion Title, Suggestion Description. All what I want now is to show the Month. For example, to show the suggestions for the last three months, the Month column should show: Jan-2012, Dec-2011, Nov-2011 So how to do that? My current SQL query: The desired output is to display: Employee Name, Username, Division, SuggestionTitle, SuggstionDescription, SuggestionType Month(submissionDate)
(comments are locked)
|
|
Hi there, try adding the following to your select statement LEFT(DATENAME(mm,submissionDate),3) + '-' + CAST(DATEPART(yyyy, submissionDate) AS VARCHAR(4)) This will add the required output Thanks
(comments are locked)
|

