What's wrong with this quarterly date formula?

This formula was created by Frodoman back in July and I am just using it now.  But I am getting an error requiring a string after FALSE.  Can someone tell me where I went wrong?

If month(currentdate) = 4 then
  {MBRSUM.CREATE_DATE} & " in " & date(1,1,year(currentdate)) & " to " &  date(1,3,year(currentdate))
else
  If month(currentdate) = 7 then
     {MBRSUM.CREATE_DATE} & " in " & date(1,4,year(currentdate)) & " to " &  date(1,6,year(currentdate))
  else
If month(currentdate) = 10 then
  {MBRSUM.CREATE_DATE} & " in " & date(1,7,year(currentdate)) & " to " &  date(1,9,year(currentdate))
else
  If month(currentdate) = 1 then
     {MBRSUM.CREATE_DATE} & " in " & date(1,10,year(currentdate)) & " to " &  date(1,12,year(currentdate))
  else
false
glabossiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dylanyeeCommented:
Each formula in crystal report returns a value, the value can be in any type. And if you use IF THEN ELSE statement, the return type is depends on the first define return type.

eg)
IF month(currentdate) = 4 then
    "some string here"
else
    true

this will cause an syntax error because it expect a string after else. the correct syntax will be
IF month(currentdate) = 4 then
     "some string here"
else
     "must be string as well"

So in your case, you should change the "false" to some string instead.

dylan
glabossiAuthor Commented:
I am not very familiar with strings.  Could you give me an example I could use with this string dylanyee?

Thank you.
glabossiAuthor Commented:
The FALSE was supposed to end the formula.  It was supposed to prevent monthly values from showing up when it wasn't the current quarter (since I am setting it to run monthly in Crystal Enterprise).
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

dylanyeeCommented:
glabossi, in your case, it depends on you to decide what should the formula return if it wasn't the belongs to current quarter, the example below simply replace the false to "", you could change it to anything. such as "false"

If month(currentdate) = 4 then
  {MBRSUM.CREATE_DATE} & " in " & date(1,1,year(currentdate)) & " to " &  date(1,3,year(currentdate))
else
  If month(currentdate) = 7 then
     {MBRSUM.CREATE_DATE} & " in " & date(1,4,year(currentdate)) & " to " &  date(1,6,year(currentdate))
  else
If month(currentdate) = 10 then
  {MBRSUM.CREATE_DATE} & " in " & date(1,7,year(currentdate)) & " to " &  date(1,9,year(currentdate))
else
  If month(currentdate) = 1 then
     {MBRSUM.CREATE_DATE} & " in " & date(1,10,year(currentdate)) & " to " &  date(1,12,year(currentdate))
  else
     ""
glabossiAuthor Commented:
I tried putting in the "" after else and  I received an error (a number must be between 1 and the number of days in a month) for this line in the formula:

date(1,1,year(currentdate))
glabossiAuthor Commented:
Any help here?
dylanyeeCommented:
yes, your date formula is wrong.
you should use date(year, month, day)
for your case is date(year(currentdate), 1, 1)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
glabossiAuthor Commented:
Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.