Select Query With Diffrent Values Only (1 Viewer)

ootkhopdi

Registered User.
Local time
Today, 23:18
Joined
Oct 17, 2013
Messages
181
Hi All

I Want to Create an Query to Find Diffrent Values in A Table/ Query
Like
Month Year Name School Post
Jan 2012 Ankur School 1 Post 1
Feb 2012 Ankur School 1 Post 1
Mar 2012 Ankur School 2 Post 1
Apr 2012 Ankur School 2 Post 2
May 2012 Ankur School 2 Post 2
June 2012 Ankur School 3 Post 2

Now i want in result of Query is only like
Month Year Name School Post
Jan 2012 Ankur School 1 Post 1 (Starting Ledger)
Mar 2012 Ankur School 2 Post 1 (Change in School)
Apr 2012 Ankur School 2 Post 2 ( Change in Post)
June 2012 Ankur School 3 Post 2 (Change in School)

How can i get the result

pls give me solution as example ..

i m too starter in access . so pls give me solution as one by one steps

thanks in advance to all persons who can help me

thanks
 

Ranman256

Well-known member
Local time
Today, 13:48
Joined
Apr 9, 2015
Messages
4,337
This sounds more like a list. Cant you just show the list (sorted by Name)?
 

ootkhopdi

Registered User.
Local time
Today, 23:18
Joined
Oct 17, 2013
Messages
181
Some one there for help me??
How can i filter different value records in diffrent fields..?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:48
Joined
May 7, 2009
Messages
19,247
use Total query:

select min([month]), min([year]), [name], school, post from table1 group by [name], school, post;
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:48
Joined
May 7, 2009
Messages
19,247
you deleted ur post, er, j7.
I will go out on a limb and say what you want is not possible within a query. This would likely require VBA code writing records to a table. And that's assuming you can clearly explain the decision logic.

So, there likely is not much help forthcoming with the limited info provided.
 

plog

Banishment Pending
Local time
Today, 12:48
Joined
May 11, 2011
Messages
11,653
With the way you have your data, you cannot do it. Since you haven't stored your data correclty the computer cannot determine the correct order you want your data.

You want to sort your data by date, however you have no date fields in your table. You have a text field to indicate your month, and a number field to indicate your year. Therefore, if you were to sort your data by year, then month it would look like this:

Year, Month
2012, April
2012, August
2012, December
2012, February
....


Since your month is text, it sorts it like text. To achieve what you want, you need a date field. Do you have one in that table?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:48
Joined
May 7, 2009
Messages
19,247
i did not noticed that its text. if that the case use First() instead of Min(). to sort:

Order by switch([month]="january", 1, "[month]="february", 2, ...)
 

Users who are viewing this thread

Top Bottom