Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

sorting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
subs - 08 Feb 2008 03:47 GMT
Ost Ocity Dstate Dcity price
A    B        C         D       34
A    B        E         F       45
X     C       L          Y      78
X     C      M         S     87
T    O       A         B     98
Q   W      A         B      86

Ost and Ocity go together. for example  A   B  is the origin in first
two rows and  A  B is the destn in last two rows- I want to sort this
data in  a report or a query such that  the origin and dest are next
to one another i.e in this example the first two rows( A B as origin)
are next to last two rows( A B as destn) . The last two rows should be
3rd and 4 th row and also i want to add a summary row (like
totals)after the first four rows(after every such sequence) . There
are 100 s of such rows in my table. How to sort it and summarize it

Please help thanks
Jerry Whittle - 08 Feb 2008 19:52 GMT
Select DISTINCT Subs.Ost,
Subs.Ocity,
Subs.Dstate,
Subs.Dcity,
Subs.price
FROM
  (SELECT [Ost] & [Ocity] AS Sort12,
  Subs.Ost,
  Subs.Ocity,
  Subs.Dstate,
  Subs.Dcity,
  Subs.price
  FROM Subs
  UNION
  SELECT [Dstate] & [Dcity] AS Sort12,
  Subs.Ost,
  Subs.Ocity,
  Subs.Dstate,
  Subs.Dcity,
  Subs.price
  FROM Subs
  ORDER BY 1)  ;
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> Ost Ocity Dstate Dcity price
> A    B        C         D       34
[quoted text clipped - 14 lines]
>
> Please help thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.