Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2005

Tip: Looking for answers? Try searching our database.

Sorting Results after Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
abc - 28 Sep 2005 21:00 GMT
When the user selects criteria and clicks Query.. the results show up
in a data section.

How do I sort the results by a certain field (for example, by the Last
Name field alphabetical order)?
Andrew Watt [MVP - InfoPath] - 28 Sep 2005 21:39 GMT
>When the user selects criteria and clicks Query.. the results show up
>in a data section.
>
>How do I sort the results by a certain field (for example, by the Last
>Name field alphabetical order)?

You can Edit the SQL when you create the form template from a data
source.

To modify the display order later in the design process select Tools |
Convert Main Data Source. Go forward one screen then click the Edit
SQL button. Add an appropriate ORDER BY clause.

Andrew Watt
MVP - InfoPath
abc - 29 Sep 2005 15:54 GMT
I'm not really good w/ sql.. I know i need to enter "order by [nes]"
but where below??

shape
    {select
[RecordID],[Year],[AreaTyp],[SpecialtyPracticeArea],[workunit],[comptype],[Building],[WorkLocation],[Role],[Job
Title]
    as
[Job_Title],[Title],[ResourcesText1],[ResourcesText2],[ResourcesText3],[ResourcesText4],[ResourcesText5],[DirectionsText1],[DirectionsText2],[DirectionsText3],[DirectionsText4],[DirectionsText5],[DirectionsText6],[MandatoryText1],[MandatoryText2],[MandatoryText3],[MandatoryText4],[Author],[AuthorLast],[AuthorFirst],[AgeGroupNeo],[AgeGroupPed],[AgeGroupAdol],[AgeGroupAdult],[AgeGroupGeri],[AgeGroupNA],[RN],[Other],[SignatureLine],[PrintNA],[CultureHispanic],[CultureSomali],[CultureBlack],[CultureViet],[CultureCambodian],[CultureSudanese],[CultureNA],[CultureDeaf],[CultureHardHearing],[CultureNotA],[RNLPNHospira],[RNPersonality],[RNDiabetes],[NonUSRestraint],[AllBasic],[RNCombo],[PCAPopulation],[USTechnology],[Date],[In
Progress] as [In_Progress],[Completed] from [Detail2005] as
[Detail2005]} as [Detail2005]
    append
        ({select
[MethodRecordID],[RecordID],[Method],[OtherSpecify],[Criteria2],[CriteriaOtherSpecify2],[CriteriaInfo2Text1],[CriteriaInfo2Text2],[CriteriaInfo2Text3],[CriteriaInfo2Text4],[CriteriaInfo2Text5],[CriteriaInfo2Text6],[CriteriaInfo2Text7],[CriteriaInfo2Text8],[CriteriaInfo2Text9],[CriteriaInfo2Text10]
from [Methods2005]}
            relate [RecordID] TO [RecordID]) as [Methods2005],
        ({select
[ResRecordID],[RecordID],[ResourcesText1],[ResourcesText2],[ResourcesText3],[ResourcesText4],[ResourcesText5]
from [Resources]}
            relate [RecordID] TO [RecordID]) as [Resources],
        ({select
[CriteriaID],[RecordID],[Criteria],[CriteriaOtherSpecifyText1],[CriteriaOtherSpecifyText2],[CriteriaOtherSpecifyText3],[CriteriaOtherSpecifyText4],[CriteriaOtherSpecifyText5],[CriteriaOtherSpecifyText6],[CriteriaOtherSpecifyText7],[CriteriaOtherSpecifyText8],[CriteriaOtherSpecifyText9],[CriteriaOtherSpecifyText10],[CriteriaOtherSpecifyText11],[CriteriaOtherSpecifyText12],[CriteriaOtherSpecifyText13],[CriteriaOtherSpecifyText14],[CriteriaOtherSpecifyText15],[InfoText1],[InfoText2],[InfoText3],[InfoText4],[InfoText5],[InfoText6],[InfoText7],[InfoText8],[InfoText9],[InfoText10],[InfoText11],[InfoText12],[InfoText13],[InfoText14],[InfoText15]
from [Criteria2005]}
            relate [RecordID] TO [RecordID]) as [Criteria2005],
        ({select
[DemonstrationID],[RecordID],[CompetencyCriteriaText1],[CompetencyCriteriaText2],[CompetencyCriteriaText3],[CompetencyCriteriaText4],[CompetencyCriteriaText5],[CompetencyCriteriaText6],[CompetencyCriteriaText7],[CompetencyCriteriaText8],[CompetencyCriteriaText9],[CompetencyCriteriaText10],[CompetencyCriteriaText11],[CompetencyCriteriaText12],[CompetencyCriteriaText13],[CompetencyCriteriaText14],[CompetencyCriteriaText15],[CompetencyCriteriaText16],[CompetencyCriteriaText17],[PrintORder]
from [Demonstration2005]}
            relate [RecordID] TO [RecordID]) as [Demonstration2005],
        ({select
[ExemplarID],[RecordID],[ExemplarText1],[ExemplarText2],[ExemplarText3],[ExemplarText4],[ExemplarText5],[ExemplarText6],[ExemplarText7],[ExemplarText8],[ExemplarText9],[ExemplarText10],[ExemplarText11],[ExemplarText12],[ExemplarText13],[ExemplarText14],[ExemplarText15],[ElementsText1],[ElementsText2],[ElementsText3],[ElementsText4],[ElementsText5],[ElementsText6],[ElementsText7],[ElementsText8],[ElementsText9],[ElementsText10],[ElementsText11],[ElementsText12],[ElementsText13],[ElementsText14],[ElementsText15]
from [Exemplar2005]}
            relate [RecordID] TO [RecordID]) as [Exemplar2005],
        ({select
[MatchingID],[RecordID],[MatchingLeftText1],[MatchingLeftText2],[MatchingLeftText3],[MatchingRightText1],[MatchingRightText2],[MatchingRightText3]
from [Matching2005]}
            relate [RecordID] TO [RecordID]) as [Matching2005],
        ({select
[ObjRecordID],[RecordID],[ObjectiveText1],[ObjectiveText2],[ObjectiveText3],[ObjectiveText4]
from [Objectives2005]}
            relate [RecordID] TO [RecordID]) as [Objectives2005],
        ({select
[TemplateID],[RecordID],[QuestionNumber],[QuestionText1],[QuestionText2],[QuestionText3],[QuestionText4],[Answer1],[Answer2],[Answer3],[Answer4],[Answer5],[Answer6],[InstructionsText1],[InstructionsText2],[InstructionsText3],[InstructionsText4]
from [Test2005]}
            relate [RecordID] TO [RecordID]) as [Test2005],
        ({select [RecordID],[Unit] from [UnitDetail2005]}
            relate [RecordID] TO [RecordID]) as [UnitDetail2005],
        ({select
[WhoRecordID],[RecordID],[Who],[WhoOtherSpecify],[Peer],[Group of
Peers] as [Group_of_Peers],[Supervisor],[Other] from [Who2005]}
            relate [RecordID] TO [RecordID]) as [Who2005]
 
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.