Traditional web-based reporting with SAS BI tools

Month and year returning null value?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Month and year returning null value?

Hello,

I have a table that contains a date column, with the following details :

Name : BILL_DATE

Type : Date

Length : 8

Format : DATETIME20.

Informat : DATETIME20.

Label : BILL_DATE

I'm trying to retrieve the month value of each row, so I'm using the computed column advanced expression with the following statement ; month(t1.BILL_DATE)

The results are Null, any ideas why this might me happening?

while on the other hand the statement datepart(t1.BILL_DATE) is returning normal values!

Thank you


Accepted Solutions
Solution
‎06-10-2015 04:49 AM
Contributor
Posts: 44

Re: Month and year returning null value?

You have to take datepart first : month(datepart(bill_date))

View solution in original post


All Replies
Contributor
Posts: 44

Re: Month and year returning null value?

Month -function is assuming that there is date as a input.

Occasional Contributor
Posts: 8

Re: Month and year returning null value?

Ok, and how can I fix this? is there a walk-around or something?

Solution
‎06-10-2015 04:49 AM
Contributor
Posts: 44

Re: Month and year returning null value?

You have to take datepart first : month(datepart(bill_date))

Occasional Contributor
Posts: 8

Re: Month and year returning null value?

Much appreicated Smiley Happy

Thank you so much

Post a Question
Discussion Stats
  • 4 replies
  • 3695 views
  • 0 likes
  • 2 in conversation