Retrieving newest records when fields are duplicated (2 nd Posting ) 
Author Message
 Retrieving newest records when fields are duplicated (2 nd Posting )

I,m writing an App that searches a database for a cutomer based on the
users input into Text1 the code is :

MyCriteria = "Customer LIKE '*" + Text1 + "*'"
    Data1.Recordset.FindNext MyCriteria
If Data1.Recordset.NoMatch Then
    Data1.Recordset.FindFirst MyCriteria
End If

Then I have a command button to show only the records from the result of
that search, the code is :
Dim chooseSQL As String
chooseSQL = "SELECT * From quotes Where customer = '" & Text3 & "';"    

Data1.RecordSource = chooseSQL
Data1.Refresh
This returns Date, Salesman, Product code, product description and price
quoted
All this works well, but my problem is that these records are price
quotes for customers some of which will be updated.
What I would like to do is bring up only the records that
are the most recent when there is duplicates of Product description. I
must admit that I
havent been at this very long . Basically I know what I want to do, but
cant seem to figure out how to do it. I know this isnt the syntax but
you will get the idea
if Product description = Product description then
give me only the records with the closest date to now
else
just give me all the records
Basically I want the sql to check all the records and if there is
duplicates then check the date of the duplicates and return the newest
quotes of the duplicates along with the other records
Thanks for any help
p.s. I posted this on the experts exchange website it was answered
incorrectly twice I hope someone can help I'm running out of resources



Wed, 29 Dec 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Retrieving newest records when feilds are duplicated (2nd Posting)

2. I am getting duplicate records, I mean everything is duplicate even Access record number

3. Nextpage in a loop, Where and how ( 2 nd posting no responce yet )

4. Duplicate records to new Table

5. Auto-filling fields in a new record with info from a previous record

6. Crystal: duplicate data in table need to filter with record selection not suppress field

7. Retrieving Automatic ID of new record

8. Problem adding new record and then retrieving the auto generated ID

9. Retrieve Autonumber after append new record...

10. I am trying to update a record, i am not using data control

11. I am trying to update a record, i am not using data control

12. adding new records & new record

 

 
Powered by phpBB® Forum Software