Jump to content

maintain DB by Financial Year


raviprakashg

Recommended Posts

Your SELECT statement would go something like this

SELECT * FROM tablenameWHERE YEAR(DateField) = YEAR(getDate())

That statement would get every record from the table that was from this yearyou could also do this

SELECT * FROM tablenameWHERE YEAR(DateField) = 2004

to get all records from 2004...fill in the year you wish to retreive...you could have a drop down list on your application that allowed your boss to choose the year then have his selection inputed intot he SQL statement before executetion.This code is for SQL Server but I think it will work in Access too since they are both MS

Link to comment
Share on other sites

Your SELECT statement would go something like this
SELECT * FROM tablenameWHERE YEAR(DateField) = YEAR(getDate())

That statement would get every record from the table that was from this yearyou could also do this

SELECT * FROM tablenameWHERE YEAR(DateField) = 2004

to get all records from 2004...fill in the year you wish to retreive...you could have a drop down list on your application that allowed your boss to choose the year then have his selection inputed intot he SQL statement before executetion.This code is for SQL Server but I think it will work in Access too since they are both MS

Another consideration if he wants to be able to do the query without having to remember to type in the year each time would be to create views that are named based on the year and search only through that year. So you would have tablename2006, tablename 2005, tablename 2004, etc. That way all the data is still stored in one place which will be much easier to manipulate later on or if you need to do full reports on all years rather than just one.
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...