How to view the Suggsetions sorted in the Database for the last three months?
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: > User Table: Username, Name, DivisionCode... etc > > Division Table: SapCode, Division > > SuggestionLog Table: ID, Title, Description, submittedDate, Username ***(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: SELECT dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsType.Type, dbo.SafetySuggestionsLog.Username, dbo.employee.Name, dbo.Divisions.DivisionShortcut FROM dbo.Divisions INNER JOIN dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode INNER JOIN dbo.SafetySuggestionsLog ON dbo.employee.Username = dbo.SafetySuggestionsLog.Username INNER JOIN dbo.SafetySuggestionsType ON dbo.SafetySuggestionsLog.TypeID =
dbo.SafetySuggestionsType.ID The desired output is to display: **Employee Name, Username, Division, SuggestionTitle, SuggstionDescription, SuggestionType Month(submissionDate)**