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

Are you running ONE query.

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())-1,1) AND
DateSerial(Year(Date()),Month(Date()),1-1)

Open a new query
Do NOT ADD any tables, just close the dialog to select tables.
Switch to SQL view (View: SQL from the menu)
Paste the above into the SQL view of the query

Run the query. IF you get a syntax error then I am baffled, but post
back and let us know what the error is.


'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


caseysmydog wrote:
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())-1,1) AND
DateSerial(Year(Date()),Month(Date()),1-1)

SELECT Table1.Deceased, Table1.[Date of Death], Table1.[Caregivers Name],
Table1.Address
FROM Table1
WHERE (((Table1.[Date of Death])="1")) OR (((Table1.[Date of
Death])=DateAdd("m",1,[DateOfDeath])))

Thank you for the above...I've tried both and they return an error:
Syntax In Subquery in this expression is incorrect.
Check the Subquery syntax & enclose Subquery in parenthesis.

I know I'm beginning to be a pain--I bought 2 books on Access today and will
study them. Any thoughts on these query's?
Thanks,