This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Using a date function to determine the day of the week of a date

This example shows the use of the date function weekday. You define a Derived Single Response variable to work out the day of the week that a particular date is.

  1. Click Variables window button to display the Variables Window.
  2. Click New button to add a new variable.
  3. Specify the Variable Details:

    Name: V6

    Label: Day of the week restaurant visited

    Type: Derived (the variable will derive its data from other existing variables).

    Response: Single (each respondent will fall into only one of the new codes, as there is only one date of visit per case).

  4. Specify the Code Details:

    Code

    Code Label

    Value

    1

    Monday

    Q1a weekday=1

    2

    Tuesday

    Q1a weekday=2

    3

    Wednesday

    Q1a weekday=3

    4

    Thursday

    Q1a weekday=4

    5

    Friday

    Q1a weekday=5

    6

    Saturday

    Q1a weekday=6

    7

    Sunday

    Q1a weekday=7

Click Save button to save the variable. The variable can then be used in tables and charts in the usual way.

See Also

Date formats

Date Functions

Categorising date responses

Calculating age from a date of birth