Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd SQL ORDER BY Behavior
Message
From
03/08/2000 19:43:41
 
 
To
03/08/2000 19:34:06
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:
00400793
Views:
16
>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform