cancel
Showing results for 
Search instead for 
Did you mean: 

compare mm/yyyy

Former Member
0 Kudos
450

Post Author: dura13

CA Forum: Formula

HI

I'm having trouble figuring out the formula to compare the month/year of 1 field versus the month/year of another.

Here's what I have sofar.

dateadd("m",-6,currentdate) this will take me back 6 months to todays date, but i want the month/year and not the month/day/year. The second variable will be an invoice date that I want to also be in the format month/year and this is where i need the year to come into play.

Any suggestions on how i can either drop the day parameter from both dates or is i just easier to do something along this line.

(dateadd("m",-6,currentdate) - (day(currentdate) - 1))

    • just thought of this formula as i was writing the question **

Thanks in advance

I realized this won't work as it only gets me to the first day of the month. I really need to format these date fields in the formula to be month/year.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Post Author: yangster

CA Forum: Formula

try reversing the order of your convert to yyyy/MM06/2007 < 07/2005 because its a string its going to look left to right

Former Member
0 Kudos

Post Author: dura13

CA Forum: Formula

IF TOTEXT(DATEADD("M",-{?MONTHS},CURRENTDATE),"MM/yyyy")< totext({so_bol_headers.bolh_invoice_date},"MM/yyyy")

back to the drawing board. almost have all the humps worked out, but now this one is causing me problems. going to try 2 compares. 1 for the month and 1 for the year.

Former Member
0 Kudos

Post Author: dura13

CA Forum: Formula

Thanks worked like a charm. I will have to readup on the totext feature, but this solution worked perfectly

Thanks again

Former Member
0 Kudos

Post Author: Charliy

CA Forum: Formula

totext({date field or formula},"MM/yyyy")

Make a formula like that for each of the dates and compare them. The M must be upper case, lower case means minute.