QUEL User Notes for POPULATION and POP2 Examples
For the $year variable, you can select the data for 1970 by running the report with the command:
Windows:
report rwqueldb pop (year=1970)
UNIX:
report rwqueldb pop '(year=1970)'
VMS:
report rwqueldb pop (year=1970)
The QUEL version of the query for this example is shown below. This query is identical for both the POPULATION and POP2 examples.
/* POPULATION - Population Report */
.NAME pop
.QUERY
range of r is region
range of s is state
range of p is pop
retrieve (r.region, s.state,
tot = p.tot_18to65 + p.tot_under18 +
p.tot_over65, p.tot_18to65, p.tot_under18,
p.tot_over65,
where s.statabbrev = p.statabbrev
and s.regabbrev = r.regabbrev
and p.year = $year