Print Page | Close Window

Formula help: next month

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22586
Printed Date: 04 May 2024 at 12:08am


Topic: Formula help: next month
Posted By: kv41282
Subject: Formula help: next month
Date Posted: 29 Apr 2018 at 8:48pm
Is there an formula what gives me the first day of the next month after a DB-date?

In the Database is a datefield, i have to count a marge of 30 days with the formula dateadd(d, 30, {db-field})
After this function i need to calculate the next first day of the next month.

For example: DB-field = 24-04-2018
With a marge of 30 days gives me: 24-5-2018
And Now i need als result 1-6-2018.

A other example: DB-field = 05-11-2018
With a marge of 30 days gives me: 05-12-2018
And Now i need als result 1-1-2019.

I’ve tried the function dateserial() , but then i have a problem by passing a new year....
Who van help me?



Replies:
Posted By: Valert16
Date Posted: 29 Apr 2018 at 10:34pm
Try this:
DateSerial(Year({db-field}), Month({db-field}) + 1, 1)



Print Page | Close Window