Delete record

G

Guest

Hi:

I have a query and a report based on it. Sometimes I have 2 records:

123 14 234 01/14/2005 7:12:48
123 0 0 01/14/2005 7:12:48

I would like to delete/not show in the report the second one when: the first
field is the same and the date/time is the same.

How do I do that?

Thanks,

Dan
 
J

Jeff Boyce

One approach would be to get only the record you want from the query. If
you started out only looking for the first field and the date/time, how
would you/Access know which one of the two in your example NOT to use?
 
G

Guest

Hi Jeff:

Thanks!

The approach I am trying is:

Created a table and the date and time fields as Unique/No duplicates; but
when I append the records for one store=field1, sometimes appends the right
record and sometimes the record with zeros? (second one below)

123 14 234 01/14/2005 7:12:48 valid to show
123 0 0 01/14/2005 7:12:48 not to show
123 0 0 01/02/2005 7:12:53 valid to show

I do not want to delete the records with zeros but different date/time.

Does it help?

Thanks,

Dan
 
J

John Spencer (MVP)

IF the record you want to HIDE is always 0 0 if another record exists. You
might try using a totals (group by query)

SELECT FirstField, Max(Field2), Max(Field3), Field4, Field5
FROM YourTable
GROUP BY FirstField, Field4, Field5

If there are more fields you need to show, you will have to give us more
details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Running Balance in Access 1
WCG Stats Thursday 10 August 2023 3
JOIN Query very slow 3
Running Balance (Debit and Credit) in Access 2007 4
Access 2003 - Transpose 7
Delete query 2
Subtotals 4
How to get using Query 4

Top