Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Access
i have a table in aceess database which coloums are below:
master code master type master name patent code
001 1 sundry debtors a-1
002 1 north delhi 001
003 1 south delhi 001
004 1 sundry creditors a-2
005 1 west delhi 004
006 2 amir chand 002
007 2 punam chand 003
008 2 cash a-1
009 2 hans raj 005
010 2 ramesh 001
 

now i want a query in which master type 2 with link 001 & 004 & their sub group
 
please help me
Posted 16-Nov-12 4:45am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use group by to do this, read here[^]. I do think you need to hard code the different group names and use union, which is sub optimal.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can use group by to do this, read <a href="http://www.sqlservercentral.com/articles/Groouping/70023/">here</a>[<a href="http://www.sqlservercentral.com/articles/Groouping/70023/" target="_blank" title="New Window">^</a>].  I do think you need to hard code the different group names and use union, which is sub optimal.
  Permalink  
Comments
ashok1282 at 16-Nov-12 11:10am
   
please give solution in access database
Christian Graus at 16-Nov-12 11:13am
   
I don't use access because it sucks. There are SQL embedded solutions that make Access a waste of time IMO. If you can't use group by, then you're hosed, you need to write script to do it manually, I expect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 365
1 Sergey Alexandrovich Kryukov 252
2 OriginalGriff 165
3 George Jonsson 159
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,860
2 CPallini 5,125
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100