Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Fri, 26 Sep 2008 12:19:01 -0700,    group: microsoft.public.access.queries        back       


Delete Query Not Working   
I have a couple of queries set up to get a very select list of records. So 
far, all of those are working properly. Now that I have what data I need, I 
would like to write a query to Delete those results with matching IDs from 
the original table.
Table "Records" - holds data regarding absences
Query "Sums"  - calculates difference between dates, sums absences
Query "PrevAnn" - all records from "Sums" who's difference is greater than 1 
year, except the most recent date.

Those are the records I would like to delete from table "records"

This is what I have for the "Delete" query:

DELETE Records.*
FROM Records INNER JOIN PrevAnn ON Records.ID=PrevAnn.ID

Am I on the right track here?
date: Fri, 26 Sep 2008 12:19:01 -0700   author:   Allie

RE: Delete Query Not Working   
Annie,

Are you still trying to delete from the linked Excel spreadsheet, or did you 
import into an Access table.

If you imported into an Access table, then you should be able to do:

DELETE Records.*
FROM Records
WHERE Records.ID IN (SELECT DISTINCT ID FROM PrevAnn)

-- 
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Allie" wrote:

> I have a couple of queries set up to get a very select list of records. So 
> far, all of those are working properly. Now that I have what data I need, I 
> would like to write a query to Delete those results with matching IDs from 
> the original table.
> Table "Records" - holds data regarding absences
> Query "Sums"  - calculates difference between dates, sums absences
> Query "PrevAnn" - all records from "Sums" who's difference is greater than 1 
> year, except the most recent date.
> 
> Those are the records I would like to delete from table "records"
> 
> This is what I have for the "Delete" query:
> 
> DELETE Records.*
> FROM Records INNER JOIN PrevAnn ON Records.ID=PrevAnn.ID
> 
> Am I on the right track here?
> 
>
date: Fri, 26 Sep 2008 12:50:02 -0700   author:   Dale Fye

RE: Delete Query Not Working   
It is a separate table. And WOO HOO it worked. Thanks Dale.

"Dale Fye" wrote:

> Annie,
> 
> Are you still trying to delete from the linked Excel spreadsheet, or did you 
> import into an Access table.
> 
> If you imported into an Access table, then you should be able to do:
> 
> DELETE Records.*
> FROM Records
> WHERE Records.ID IN (SELECT DISTINCT ID FROM PrevAnn)
> 
> -- 
> HTH
> Dale
> 
> Don''t forget to rate the post if it was helpful!
> 
> email address is invalid
> Please reply to newsgroup only.
> 
> 
> 
> "Allie" wrote:
> 
> > I have a couple of queries set up to get a very select list of records. So 
> > far, all of those are working properly. Now that I have what data I need, I 
> > would like to write a query to Delete those results with matching IDs from 
> > the original table.
> > Table "Records" - holds data regarding absences
> > Query "Sums"  - calculates difference between dates, sums absences
> > Query "PrevAnn" - all records from "Sums" who's difference is greater than 1 
> > year, except the most recent date.
> > 
> > Those are the records I would like to delete from table "records"
> > 
> > This is what I have for the "Delete" query:
> > 
> > DELETE Records.*
> > FROM Records INNER JOIN PrevAnn ON Records.ID=PrevAnn.ID
> > 
> > Am I on the right track here?
> > 
> >
date: Fri, 26 Sep 2008 12:56:20 -0700   author:   Allie

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us