There seems to be an error here: Int ( Dateofprenatal - ( Pregnancies::EDDforWGA - 280 ) / 7 )
looks like it should be: Int ( ( Dateofprenatal - Pregnancies::EDDforWGA - 280 ) / 7 )
when I compare it to the Mod function you use later in the same expression.
Also, check the value in Dateofprenatal. Make sure this field is of type date or a calculation field with Date selected as its return type. You can simplify your expression a bit if you want to:
Let ( start = Dateofprenatal - Pregnancies::EDDforWGA - 280 ; Div ( start ; 7 ) & "w " & Mod ( start ; 7 ) &"d" )
Thanks, working now. Thanks Phil. Thinking I need a class.
May I get some assist, too? I am trying to understand which are your fields:
what is the Pregnancies field? Do you also have a field for EDDforWGA?
EDDforWGA is a field, and Pregnancies is the table it comes from. Hence, Pregnancies:EDDforWGA.
I'm read through your instructions, but I don't why it didn't work for me. This is my formula:
((TODAY - LMP) / (60 * 60 * 24)) / 7 , TODAY being the instructions for putting in the present day, and LMP being date field that I've entered. It actually works, except it doesn't give me week and day, only the number representing the week, rounding up - 35 weeks 5 days will give me 36. I can use decimal, but it's not what I want achieve.
I am interested in getting a wk and day format such as 23w2d. I am willing to separate it into 2 fields, one for Week and Day.