INTNX function returns only null values?

Accepted Solution Solved
Reply
Occasional Contributor ewv
Occasional Contributor
Posts: 11
Accepted Solution

INTNX function returns only null values?

I am trying to use the INTNX function within Proc SQL. I'd like it to convert my DATEVARIABLE to the first day of the week for a series of dates spanning several years. The coded I'm using is below.

PROC SQL;
SELECT intnx('week',DATEVARIABLE,0,'B') AS CalendarWeek
FROM Table
QUIT;

The issue I'm having is that it only returns null values. My expectations is that it would take any day of the week and output the beginning day (Sunday in this case).

 

Any suggestions to try would be helpful.

 

Thank you!


Accepted Solutions
Solution
‎07-11-2017 06:16 PM
Super User
Posts: 19,105

Re: INTNX function returns only null values?

1. Are there any errors in your log

2. Do you have a date or datetime variable? If it's datetime variable use DTWEEK or WEEKDT as the interval not WEEK, sorry can't recall the order.

View solution in original post


All Replies
Solution
‎07-11-2017 06:16 PM
Super User
Posts: 19,105

Re: INTNX function returns only null values?

1. Are there any errors in your log

2. Do you have a date or datetime variable? If it's datetime variable use DTWEEK or WEEKDT as the interval not WEEK, sorry can't recall the order.

Occasional Contributor ewv
Occasional Contributor
Posts: 11

Re: INTNX function returns only null values?

1. No errors in the log

2. It is a datetime variable! I'll try those options and report back shortly

Occasional Contributor ewv
Occasional Contributor
Posts: 11

Re: INTNX function returns only null values?

DTWEEK did the trick. Thank you!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 194 views
  • 1 like
  • 2 in conversation