Access Formula

NJLOAD

Senior member
Jun 8, 2001
582
0
0
I am working on a service database for my brother. He has an appliance repair business and one of the reports I?m trying to design is for reporting Monthly Sales Tax. I built a Query using this formula: DatePart("m",[Date]) . This works great but it pulls all the data by month only and could span across multiple years is there a way to modify the formula to extract by year also I tried: DatePart("m","YYYY",[Date]) and this doesn?t work.

Any help is appreciated as usual.
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126


Add this condition to your query (will give you a month worth of data):

WHERE [Date] BETWEEN '1/1/2009' AND '2/1/2009'


PS I strongly discourage you from using the column name Date in any database platform since it is a reserved word. It does work, but is just recommended you don't use it.
 

NJLOAD

Senior member
Jun 8, 2001
582
0
0
KB thanks for the reply, can you think of an easier way to do this? My sister in law is the one using the program and it is pretty much menu driven, sooner or later she could get used to opening the query and entering the dates, but was just wondering.

thanks again.