Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function - How many days of the month

Status
Not open for further replies.

McAhren

Programmer
Dec 20, 2002
8
0
0
US
Hi,
Does anyone know the function in Crystal to count how many days are in the current month?

Thanks for your help, LM
 
There isn't one.

You can use a formula like:

WhilePrintingRecords;
NumberVar MaxDay;

If Month(Date) in [4,6,9,11]
Then MaxDay = 30
Else
If Month(Date) in [1,3,5,7,8,10,12]
Then MaxDay = 31
Else
If Month(Date) = 2
Then If Year(Date) in [2000,2004,2008,2012]
Then MaxDay = 29
Else MaxDay = 28;

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top