Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2004, 10:58 AM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Have someone help me please!!

How can I filter the date like row 2 and row 5(row 7 and row 8) and also I couldn't make same column on the result of query ? Have someone can help me please?

My query statement as below:

SELECT DISTINCT C.FCommonName , A.BCommonName as BCommonName1, B.BCommonName as BCommonName2
FROM BIRDS A, BIRDS B, Families C
where B.FCODE = A.FCODE
and A.FCODE = C.FCODE
and A.BCommonName <> B.BCommonName

The result as below:

FCommonName BCommonName1 BCommonName2
---------------- ------------------------ ------------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Black Browed Albatross Wandering Albatross
Albatrosses Shy Albatross Black Browed Albatross
Albatrosses Shy Albatross Wandering Albatross
Albatrosses Wandering Albatross Black Browed Albatross
Albatrosses Wandering Albatross Shy Albatross
Broad Tailed Parrots Budgeriagar Cockatiel
Broad Tailed Parrots Cockatiel Budgeriagar

This query is about type of birds that belong to the same family. Where this occurs, display the family's common name (FCommonName) and then the bird's common names (BCommonName) in pairs, in the style shown below.

FCommonName BCommonName BCommonName
------------------------------ -------------------------- --------------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Wandering Albatross Black Browed Albatross
Albatrosses Wandering Albatross Shy Albatross
Broad Tailed Parrots Cockatiel Budgeriagar
Cormorants Great Cormorant Pied Cormorant
Eagles, Kites & Goshawks White BelliedSeaEagle Wedge Tailed Eagle
Fairy Wrens Superb Fairy Wren Red Backed Fairy Wren
Falcons Peregrine Falcon Australian Kestrel
Geese, Swans & Ducks Black Swan Pacific Black Duck
Geese, Swans & Ducks Black Swan Maned Wood Duck
Geese, Swans & Ducks Pacific Black Duck Maned Wood Duck

NB:
Do not show the same pair of birds more than once. For example, it would be wrong if the first row above appeared as the two rows below:

FCommonName BCommonName BCommonName
--------------------- ------------------------ ----------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Shy Albatross Black Browed Albatross
 
Old April 18th, 2004, 11:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you need to clarify a little. Your table appears to have two fields of the same name (BCommonName). Or is this already the result of a query?

Clive Astley









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.