Formula "Month" in a data source format ?

Hi 

I have made a format on top of my data source.

I would like to create a new column that tells me how many days there are in a specific month. 

I thought I could use a formula like:

if month(&Dato)=1 then 31 else if month(&Dato)=2 then 28 else etc.

But the formula "month(&Dato)" dosn't seem to work? 

Anyone can spot what I've done wrong?

2

Comments

2 comments
  • I can get date(2021,1,1) to work:

    And this formula is "green", but does not get the right result (31 in the first row where Dato = 1/1/2021)

    Any other suggestions to a solution? 

    0
  • Hmm, I think I found a work around.. But I still wonder why month(&Dato) didn't work.. :-)

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post