Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4781 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've created a birthdate, Now I need to extract into number form the Month, Day and Year. Certainly there is a simple solution to this...

I;ve tried Brian Dunning's as follows with no success so far...

Case (

Patient_DateofBirth = "January"; 1;

Patient_DateofBirth = "February"; 2;

Patient_DateofBirth = "March"; 3;

Patient_DateofBirth = "April"; 4;

Patient_DateofBirth = "May"; 5;

Patient_DateofBirth = "June"; 6;

Patient_DateofBirth = "July"; 7;

Patient_DateofBirth = "August"; 8;

Patient_DateofBirth = "September"; 9;

Patient_DateofBirth = "October"; 10;

Patient_DateofBirth = "Nov"; 11;

Patient_DateofBirth = "November"; 11;

Patient_DateofBirth = "december"; 12;

// default

0

)

Much thanks all!

Dr.L

Posted

Bingo! When now that was easy enough...swear I tried that first, must have missed something as it returned the name of the month. Must have only used it as a text rather than as a number in the calculation...

This works also for day and year. THANK YOU!

Dr.L

Posted

The MonthName() function returns the name of the month.

Posted

Understood...as usual it must have been user error. I believe I may have had it returned as a text rather than as a number...all is well now!

Dr.L

Posted

I believe I may have had it returned as a text rather than as a number...all is well now!

Just to clarify: the Month() function always returns a number; if you set the result to Text, it will be converted to digits of that number. For example:

Month ( SomeDate ) // returns 4 (number)

GetAsText ( Month ( SomeDate ) ) // returns "4" (text)

Posted

It seems as though I do have one more question about the date format...once I use:

Year (date), how can I trim it to just show the last two digits for the year?

Dr.L

This topic is 4781 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.