Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-31-2015, 07:15 AM   #1
DaRTHY
Newly Registered User
 
Join Date: Mar 2015
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
DaRTHY is on a distinguished road
same records need to see only 1

Hello

If you check my picture, some Records are similar and i need to filter them. (this is a query by the way.)

For example 3303933 these are 3 records, i want to see only one (Dates and other thing are not important.

I tried TOTAL option but could not find any thing there.

Hope so you can help me, because after this i ll finish my project.
Attached Images
File Type: jpg qq.jpg (37.3 KB, 58 views)

DaRTHY is offline   Reply With Quote
Old 08-31-2015, 07:19 AM   #2
Isskint
Slowly Developing
 
Isskint's Avatar
 
Join Date: Apr 2012
Location: Wiltshire, UK
Posts: 1,301
Thanks: 124
Thanked 311 Times in 304 Posts
Isskint will become famous soon enough
Re: same records need to see only 1

Hi DaRTHY

You need the DISTINCT keyword. So SELECT DISTINCT...... If the other fields are not important, take them out of the query.
__________________
Isskint, i get satisfaction out of helping others
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Success is the sum of small efforts, repeated day in and day out
Isskint is offline   Reply With Quote
Old 08-31-2015, 07:19 AM   #3
plog
Banishment Pending
 
Join Date: May 2011
Posts: 9,403
Thanks: 11
Thanked 2,282 Times in 2,234 Posts
plog is a jewel in the rough plog is a jewel in the rough plog is a jewel in the rough
Re: same records need to see only 1

If dates and other things aren't important, don't bring them into the query. Then, make an aggregate query (click the Sigma/Summation symbol in the ribbon) and you will have the results you want.

plog is offline   Reply With Quote
Old 08-31-2015, 10:46 PM   #4
DaRTHY
Newly Registered User
 
Join Date: Mar 2015
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
DaRTHY is on a distinguished road
Re: same records need to see only 1

IT WORKS

Thanks both of you

I used Property Sheet Unique Values. And Show option for others removed. (they are still there. Only from show option removed)
DaRTHY is offline   Reply With Quote
Old 05-11-2016, 06:35 AM   #5
DaRTHY
Newly Registered User
 
Join Date: Mar 2015
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
DaRTHY is on a distinguished road
Re: same records need to see only 1

Hello Friends,

I have same Problem again. Last time i could find a solution because only 1 Field was enough to show and count to all Records.

Now i need again like "DISTINCT" or "Summation symbol" but i don't have only one Field to show at this time....

If i take to my Query only 1 field Project_NR :I am getting 1958 Records.
and i ll take on my Query 3 Fields and now im getting 13873Records.

I need max 1958 records thats mean...

I have a Date and im sorting as "Ascending" because i need oldest dates f0r every Project number.

"1 project number", "doesnt matter which number","oldest Date"

I am sending a pictures and you can see there. (i marked off Yellow, which one i need.)

how can i ignore the other Records ? every Project number shall show me oldest dates.

Thanks for your helps....
DaRTHY is offline   Reply With Quote
Old 05-11-2016, 06:43 AM   #6
plog
Banishment Pending
 
Join Date: May 2011
Posts: 9,403
Thanks: 11
Thanked 2,282 Times in 2,234 Posts
plog is a jewel in the rough plog is a jewel in the rough plog is a jewel in the rough
Re: same records need to see only 1

You would build a subquery. Let's call it 'Sub1'. It would determine the earliest date (let's call it 'EarliestDate' for each Project_NR.

Then you would build another query. It would be based on your original table and Sub1. You would link them via Project_NR and EarliestDate to the date field. You would then show all records from your original table and that would give you the results you want.
plog is offline   Reply With Quote
Old 05-12-2016, 10:06 PM   #7
DaRTHY
Newly Registered User
 
Join Date: Mar 2015
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
DaRTHY is on a distinguished road
Re: same records need to see only 1

the question is how can i determine ? Normally i need this kind of code :

Quote:
" if Project_nr is same
compare dates
take early one. "
i really dont know how can i write sql code like this...

DaRTHY is offline   Reply With Quote
Old 05-13-2016, 03:32 AM   #8
DaRTHY
Newly Registered User
 
Join Date: Mar 2015
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
DaRTHY is on a distinguished road
Re: same records need to see only 1

i guess i found my answer in forum.

http://www.access-programmers.co.uk/...d.php?t=214559

and this is someone wrote in this thread :

http://www.baldyweb.com/LastValue.htm

Last edited by DaRTHY; 05-13-2016 at 04:16 AM.
DaRTHY is offline   Reply With Quote
Old 05-13-2016, 05:13 AM   #9
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,238
Thanks: 93
Thanked 2,025 Times in 1,972 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: same records need to see only 1

Further to the advice given, I suggest you find and work through some tutorials that deal with queries. There are many free youtube videos dealing with 1 table and multi-table queries.
It isn't clear (to me anyway) if your issue is with :
- clearly identifying the issue involved,
- how to write a query (Access query grid)
- using vba or SQL
- experience with database concepts and retrieval techniques.

Use Google to identify some tutorials ( a couple of examples)
http://www.techonthenet.com/access/queries/
http://www.makeuseof.com/tag/quick-t...t-access-2007/

Good luck.

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VBA Checkbox code ticking all records on report. How to target individual records? Garindan Reports 3 11-13-2013 09:11 AM
Carryforward - previous records as the basis for new records in a conUnsolved Problem dkc123 Forms 3 03-22-2012 07:33 AM
Append records to a table, based on checked subform records on previous form JohnMarb Forms 0 02-08-2012 12:36 AM
“Nested” copy and paste facility for related sub-records and sub-sub-records Big Pat Modules & VBA 1 08-03-2010 02:04 PM
Problem with new subform records creating new main form records meadows43 Forms 1 06-06-2003 06:27 PM




All times are GMT -8. The time now is 07:20 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World