Formatting code for UserSortFields


show source only

======Listing Patients With ""UserSort"" Fields======

Back to [[QueryDirectory Query Directory]]

//
I am trying to do a query on the additional tab of a client.
We have renamed the 3 squares (in a row) and not sure what they were called Can you give me a query that will get any of the 3 squares. I would never run them all at the same time however would run 1 at a time.
//
The three customizable fields on the Additional Tab are "usersort", "usersort2", and "usersort3". You can find them in the PATIENTS table and in the RV_PATIENTS view. The example below includes all three, but you can remove any you do not want from the SELECT list:

%%(sql)
SELECT
lastname,firstname,id,usersort,usersort2,usersort3
FROM
/*you can select from either PATIENTS or RV_PATIENTS*/
patients
WHERE
/*the following conditions filter out all but active patients in the main data set */
flag = 0
AND dischargedate IS NULL
AND licnum = 101
ORDER BY
lastname,firstname,id

%%


----
CategoryQueries
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki