Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd SQL ORDER BY Behavior
Message
From
03/08/2000 20:03:29
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00400758
Message ID:
00400801
Views:
16
I changed it to Job_desc and still have the same problem.


>>Boy did I ever do a poor job of explaining this one! Bad day for brain work!
>>
>>We are trying to distinguish between our various types of "CLINICAL ASSOCIATES" by adding some other text which is stored separately from the JobCode and JobDesctiption. The other text is "Nurse Practitioner" for several people and for one person, "Nurse Practitioner - PBMTU"
>>
>>I put the text together with this code:
>>
>>PADR(ALLT(Jobs.JobDesc) + ;
>>IIF(Jobs.Job = [1578], ;
>>[ - ] + PedDemog.AdminTitle, []), 60) AS JobDesc ...
>>
>>As you can see, the fields are all padded to the same length.
>>
>>The person with PBMTU continually shows up in the middle of the Nurse Practitioners, which messes up my report grouping.
>>
>
>Can you call JobDesc something other than JobDesc, maybe JobDescr, to cleanly identify the result field, and then ORDER BY using output field names rather than using field order numberings?
>
>ORDER BY ...,JobDescr leaves no room for confusion - it exists in the output and not in the input; it's vaguely possible that you already have a JobDesc in the query set, or that the field numbering is screwy...
>
>>All I can think of is that the SQL is ordered by the original value (CLINICAL ASSOCIATE) and then the Nurse Practitioner and the PBMTU is added on, rather than the whole field being put together and then ordered.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform