I isabel2005 Registered User. Local time Today, 01:15 Joined Oct 6, 2005 Messages 19 Mar 5, 2008 #1 Hi, How do I query the last 2 years vs. current date? Basically, I want to see the record from today date back to 2 years. Please assist... Thanks, Isabel Attachments dbSample.zip dbSample.zip 10.8 KB · Views: 119
Hi, How do I query the last 2 years vs. current date? Basically, I want to see the record from today date back to 2 years. Please assist... Thanks, Isabel
Mile-O Back once again... Local time Today, 06:15 Joined Dec 10, 2002 Messages 11,316 Mar 5, 2008 #2 By using the DateAdd() function in your query.
M mdb4me Registered User. Local time Today, 15:15 Joined Aug 6, 2007 Messages 16 Mar 6, 2008 #3 Use the DateAdd and Date functions to specify a period 2 years prior to current date. Code: SELECT tblItems.Code, tblItems.Item, tblItems.Date, tblItems.Price FROM tblItems WHERE (((tblItems.Date) Between DateAdd("yyyy",-2,Date()) And Date()));
Use the DateAdd and Date functions to specify a period 2 years prior to current date. Code: SELECT tblItems.Code, tblItems.Item, tblItems.Date, tblItems.Price FROM tblItems WHERE (((tblItems.Date) Between DateAdd("yyyy",-2,Date()) And Date()));
I isabel2005 Registered User. Local time Today, 01:15 Joined Oct 6, 2005 Messages 19 Mar 6, 2008 #4 Thank you very much!!!!!!!!!!!!!!!!!!!!!!! Muah!