Jump to content

Select Date Question


DaNuGai

Recommended Posts

Is is a little bit different question then what I have seen people ask here.....I have a table called Event. In the table I have a date field. I want to Select specific fields and retrive events from the begining of this month to the end of february. In other words, 3 months span.This is what I have,

SELECT EventDate, EventID, EventTitle, Event, DeptCodeFROM EventsWHERE DeptCode == '2'ORDER BY EventDate ASC

Now my question is where/how do I ask for events in 3 monts span.Please Help.

Link to comment
Share on other sites

Use a function to add 3 months to the current date, and get all events within the start and end dates. Depending on what database you are using, the function name and syntax may be a little different.
First of all, thank you for your help.I am using MySQL. I am using an application that can access MySQL where I would be putting the code. Everything works with the code I posted above expcept filtering data to 3 month period. I not very familiar with MySQL, I just know how to do the basics. I don't think I know how to write a function. Is there any link that you can refer me to.Thanks once again....
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...