View Single Post
  #28  
Old December 15th, 2008, 10:16 PM posted to microsoft.public.access.gettingstarted
caseysmydog
external usenet poster
 
Posts: 17
Default Can I do this in Access? Please help

John, this working very well except for the 12 month query.
For instance, we had 4 people die in Dec., '07.
Yet it pulls only 2.
The other two are lower day dates in Dec. than the two pulled.
For all the other months, the formula has pulled successfully and the day
dates do not affect, can be higher or lower.
Can you share your thoughts?
Many thanks
--
David


"John Spencer" wrote:

For three months, you would need

SELECT Table1.Deceased
, Table1.[Date of Death]
, Table1.[Caregivers Name]
, Table1.Address
FROM Table1
WHERE Table1.[Date of Death] Between
DateSerial(Year(Date()),Month(Date())-3,1) AND
DateSerial(Year(Date()),Month(Date())-2,1-1)

For 6 months
SELECT Table1.Deceased
, Table1.[Date of Death]
, Table1.[Caregivers Name]
, Table1.Address
FROM Table1
WHERE Table1.[Date of Death] Between
DateSerial(Year(Date()),Month(Date())-6,1) AND
DateSerial(Year(Date()),Month(Date())-5,1-1)

For 12 months
SELECT Table1.Deceased
, Table1.[Date of Death]
, Table1.[Caregivers Name]
, Table1.Address
FROM Table1
WHERE Table1.[Date of Death] Between
DateSerial(Year(Date()),Month(Date())-12,1) AND
DateSerial(Year(Date()),Month(Date())-11,1-1)

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'================================================= ===


caseysmydog wrote:
The query is working fine...trying to understand the relationship of the
number 1s in the query.
If I need to change the 1 to a 3(for 3 months) which to change?
Thanks again.