Hi. I'm writing a very simple query from a table that contains a column (CREATE_DT) which, elsewhere SAS recognizes** as a valid date field without any complaints. Well, when I add a computed column to select, as an experiment, just to show me the week number of a returned CREATE_DT, it just won't work. I have a very simple computed column with the following statement: WEEK(CREATE_DT) AS WeekNum WeekNum above returns only dashes for all records. Even MONTH(), which works in WHERE clauses, also returns only dashes. I tried out several functions in several columns with CREATE_DT as arguments, including DATE, TIME, HOUR, QUARTER, JULIANDATE, WEEKDAY, etc. Only the functions DATE, HOUR, and SECOND returned values (and the values are correct). All the rest returned dashes. Are these functions broken when used in computed columns...? How do I get WEEK() and others to work as expected??? **When I say recognizes elsewhere, I mean that (e.g.) MONTH (t1.CREATE_DT) returns only records with CREATE_DT in a month of November, as expected.
... View more