473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Delete query problem

Hi All,

I have a table with a date field and 6 number fields. The number fields are
not in numerical order across the fields and I want number 1 to be the
lowest number and number 6 to be the highest. I have come up with the idea
to create a new table with a date and number field only. I have then put all
the records from the first table into the new table which has only the 2
fields.
I then run an append query into a 3rd table with the min of ball and the
date from table 2. I then need to delete the date and min of ball records
and then run the append query again and this is where I am having the
problem.

The delete query keep throwing up an alert that I need to specify the table
I wish to delete from. Below is the query:
DELETE Table1.Date, Table1.Ball
FROM Table1 LEFT JOIN [min of ball] ON (Table1.Ball = [min of
ball].MinOfBall) AND (Table1.Date = [min of ball].Date)
WHERE (([table1].[date]=[min of ball].[Date]) AND ([table1].[ball]=[min of
ball].[minofball]));

When viewing the query in datasheet view, it shows all the records I need to
delete but when I run the query I get this error. Could anyone offer any
help please????
Nov 12 '05 #1
1 2215
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Not sure this will work, but....

DELETE Table1.*
FROM Table1 LEFT JOIN [min of ball]
ON (Table1.Ball = [min of ball].MinOfBall)
AND (Table1.Date = [min of ball].Date)

You just need the Table1.* in the DELETE clause and you don't need the
WHERE clause 'cuz it is the same as the ON clause.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDKjxIechKqOuFEgEQIYogCgi3tI0oH9zqma56rJorRMZp QdJLUAoMpw
tD/boT7SaSAr4BzchV1ClNDc
=1eUH
-----END PGP SIGNATURE-----
Mark Reed wrote:
Hi All,
< snip > I then need to delete the date and min of ball records
and then run the append query again and this is where I am having the
problem.

The delete query keep throwing up an alert that I need to specify the table
I wish to delete from. Below is the query:
DELETE Table1.Date, Table1.Ball
FROM Table1 LEFT JOIN [min of ball] ON (Table1.Ball = [min of
ball].MinOfBall) AND (Table1.Date = [min of ball].Date)
WHERE (([table1].[date]=[min of ball].[Date]) AND ([table1].[ball]=[min of
ball].[minofball]));


< snip >

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: r | last post by:
I am trying to do a delete query like this one: DELETE FROM pending WHERE pages.url=pending.url AND pages.date=pending.date; If I run it (via PHP) I get the following error: Unknown table...
1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
by: Joe Del Medico | last post by:
I have two tables A & B and I want to delete all the records in A that are not in B. Can I do this in the query builder? It seems like a simple problem. I can easily find the records in A that...
2
by: Dave Burt | last post by:
Hi, Access officionados, I'm new here, so please cut me slack/gently tell me off if I'm out of line or in the wrong place. OK, here's something that seems silly (and is also problematic to...
8
by: John Baker | last post by:
Hi: Access 2000 W98! I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a...
11
by: Sheldon Glickler | last post by:
I have code that does not delete from a database. The same code (cut an paste in the same file, but different function and having a different query) works. So, of course, I tested the query...
4
by: Ian | last post by:
Hi, I have a problem with delete using where in clause. This is a query: delete from tab1 where id not in (select id from tab2) I calculated costs using select instead of delete: select...
7
by: alan_conoco | last post by:
Hi all, I am trying to delete a subset of records (identified using my InsertRemovePairs query) from a table names TradesDone. When I execute the nested SELECT on its own it returns the...
3
by: Phil Stanton | last post by:
I have a form based on a complex query (Lots of tables) If I delete a record, everything appears to be OK. Get the message "Youa are about to delete 1 record ....". I say yes. The record count...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.