Query Advanced for Secondary Schools Section 270 - Page 6
• Using "Null" or " "
(Looking for students with no course requests)
LIST STU SSS STU.SN STU.NM STU.GR STU.CU BY STU.CU IF SSS.SN = NULL
(Using a populated user field as the criteria.)
LIST STU NM PG AD CY ZC TL MW FW IF U7 # " "
• Working with dates
(The colon following BD means CONTAINS with “*” representing “any day” and “any year”, while the “?”
after BD will produce the age of the student.)
LIST STU TCH TCH.TE STU.NM STU.BD STU.BD? IF STU.BD : 12/*/*
(Students who have not had the 1
st
polio shot – no date is entered)
LIST STU IMM STU.SN STU.NM IF IMM.P1 = NULL
USING CONNECTIVES "AND" and "OR"
Using connectives "And" and "OR":
When using AND all records must meet all of the IF conditions.
LIST STU TST CTL CTL.NM TST.SN STU.NM TST.ID TST.GR TST.RS TST.SS TST.PL TST.TD BY
STU.NM TST.PT IF TST.ID : CST AND TST.TD : */*/2008
When using an OR the records must meet either condition.
LIST STU GRD CRS TCH TCH.TE STU.NM CRS.CO GRD.M1 IF GRD.M1 : D OR GRD.M1 : F
When combining AND with multiple OR parts in an IF STATEMENT, encase the OR portion in
( ) and place a space before and after each parenthesis.
LIST STU GRD CRS TCH TCH.TE STU.NM CRS.CO GRD.M1 IF ( GRD.M1 : D OR
GRD.M1 : F ) AND STU.GR = 9
*Note the “OR” portion of the condition is placed inside of ( ) so as to be considered one condition
when the “AND” portion is added.
SORTING DATA – ASCENDING OR DESCENDING ORDER
When a LIST query is generated the program determines which field will be used to sort in ascending
order. For example LIST STU is sorted in ascending order by student last name. When creating a query
the sort can be changed to descending order. To descend a query statement you must either use DESC,
REV, or ^ symbol after the field in the BY portion of the query. If more than one sort field is selected the
first sort field entered will be used to determine the page break in Aeries formatted reports.
LIST STU SEC MST TCH CRS MST.SM MST.PD STU.SN STU.NM TCH.TE CRS.CO BY TCH.TE
MST.PD IF MST.SM = F OR MST.SM = Y
A query sort order reversed to descending order has REV added after the sort field. Also, as soon as BY
is entered into the query, REV displays on the left-side menu below the commands.
LIST STU ADS STU.SN STU.NM STU.GR STU.SX ADS.CD ADS.CD? ADS.DS BY STU.GR REV IF
ADS.CD # " "
A sort on more than one field can also be setup to descend with one field and ascend with another.
LIST STU ADS STU.SN STU.NM STU.GR STU.SX ADS.CD ADS.CD? ADS.DS BY STU.GR REV
STU.SX IF ADS.CD # " "