Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select data from the previous 3 months on a rolling basis 1

Status
Not open for further replies.

kiwieur

Technical User
Joined
Apr 25, 2006
Messages
200
Location
GB
Hi,

I have been looking at the following thread

thread701-1278381

and it seems to meet my requirments however when I use the code that SkipVought supplied all it does is show me the data for the current month i.e. March 2009.

Could someone have a look at it for me please and tell me where I am going wrong.

Code:
SELECT FACTRY.spec_number, FACTRY.Job_number, FACTRY.stock_manuf_flag, FACTRY.machine_number, FACTRY.finish_date, FACTRY.quantity_good_out
FROM FACTRY
WHERE (((FACTRY.stock_manuf_flag)=1) AND ((FACTRY.machine_number)=1910) AND ((FACTRY.finish_date)>=DateSerial(Year(Date()),Month(Date()-4),1)));

Regards

Paul

 
You've placed the -4 in slightly the wrong place:
Code:
>=DateSerial(Year(Date()),Month(Date())[red]-4[/red],1)));
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top