BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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

1 ACCEPTED SOLUTION

Accepted Solutions
AskoLötjönen
Quartz | Level 8

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

View solution in original post

4 REPLIES 4
AskoLötjönen
Quartz | Level 8

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

MustafaAbdelhaq
Calcite | Level 5

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

AskoLötjönen
Quartz | Level 8

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

MustafaAbdelhaq
Calcite | Level 5

Much appreicated Smiley Happy

Thank you so much

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 6357 views
  • 1 like
  • 2 in conversation