User Guide
33
Data Files
E
The two expressions are usually connected by a relational operator, such as = or >. To
choose the relation, put your cursor in the Relation cell and either type the operator
or select it
from the drop-down menu.
Dates and ti
mes in expressions need to be specified in a special manner (including the
curly braces shown in the examples):
Date literals should be specified using the general form: {d yyyy-mm-dd}.
Time literals should be specified using the general form: {t hh:mm:ss}.
Date/time literals (timestamps) should be specified using the general form: {dt
yyyy-mm-dd
hh:mm:ss}
.
Functions.
A selection of built-in arithmetic, logical, string, date, and time SQL
functions is provided. You can select a function from the list and drag it into
the expression, or you can enter any valid SQL function. See your database
documenta
tion for valid SQL functions. A list of standard functions is available at:
http://msdn.microsoft.com/library/en-us/odbc/htm/odbcscalar_functions.asp
Use Random Sampling. Selects a random sample of cases from the data source.
For large data sources, you may want to limit the number of cases to a small,
represen
tative sample. This can significantly reduce the time that it takes to run
procedures. Native random sampling, if available for the data source, is faster than
SPSS random sampling, since SPSS random sampling must still read the entire
data sour
ce to extract a random sample.
Approxi
mately.
Generates a random sample of approximately the specified
percentage of cases. Since this routine makes an independent pseudo-random
decision for each case, the percentage of cases selected can only approximate
the spec
ified percentage. The more cases there are in the data file, the closer the
percentage of cases selected is to the specified percentage.
Exactly. Selects a random sample of the specified number of cases from the
specified total number of cases. If the total number of cases specified exceeds
the tot
al number of cases in the data file, the sample will contain proportionally
fewer cases than the requested number.
Prompt
for Value.
You can embed a prompt in your query to create a parameter query.
When users run the query, they will be asked to enter information specified here. You
might want to do this if you need to see different views of the same data. For example,