View Single Post
  #27  
Old November 17th, 2008, 11:57 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 2,364
Default Can I do this in Access? Please help

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.