Re: Help needed with Date Add function
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Wed, 9 Jan 2008 08:39:01 -0500
SELECT Plant, [Date], Scale
FROM [Your Table]
WHERE DateSerial(Year([Date]), Month([Date]) + 1 + [Scale],0) <
DateSerial(Year(Date()),Month(Date())+1,0)
In the query grid, you need to add a calculated field
Field: DateSerial(Year([Date]), Month([Date]) + 1 + [Scale],0)
Criteria: < DateSerial(Year(Date()),Month(Date())+1,0)
By the way Date is a bad name for a field. It is the name of the function
Date() and as such can get Access confused as to whether you want the Date()
function (returns today's date) or the field named date. If possible I
would suggest you rename the field ServiceDate or LastServiceDate or some
other variation.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"CP" <CP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:887E0162-F858-4C3C-8DC5-DC3453BF2284@xxxxxxxxxxxxxxxx
I have managed to get myself completey confused please help
I am trying to work out my recall time on listed equipment (when is it
overdue)
Here are my fields
[Plant] - with unique ID
[Date] - date of last service
[Scale] - time in months of next recall (ie 6 or 12)
So lets assume its the 1st Jan, I need something to show anything that is
due/overdue from the end of the calender month (Jan 31st) using the
original
service date+time scale which will also pick up those still not sorted
from
previous months (Dec/Nov etc) - if that makes sense
many thanks
.
- Follow-Ups:
- Prev by Date: Re: Organize Data Like a Cross Tab, without unneccessary Blanks
- Next by Date: Re: Serial number in Queries
- Previous by thread: Re: Serial number in Queries
- Next by thread: Re: Help needed with Date Add function
- Index(es):
Relevant Pages
|