Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Number of Days in a Month Post Reply Post New Topic
Author Message
coo7coo7
Newbie
Newbie
Avatar

Joined: 24 Sep 2008
Location: India
Online Status: Offline
Posts: 1
Quote coo7coo7 Replybullet Topic: Number of Days in a Month
    Posted: 29 Sep 2008 at 5:55am
HI guyz i need some help in crystal reports
 
i need a formula to find the number of days in a the month for a given date
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 29 Sep 2008 at 7:14am
Hi
 
Create formula to get current month
 
Local numbervar m:= month(CurrentDate) + 1;
Local numbervar y:= year(CurrentDate);
If m>12 then
(m:=m-12; y:=y + 1);
Date(y,m,1)-1;
 
then create another formula to get No of Days
 
 
the above formulas are from Chelsea Technologies Ltd - Crystal Clear
 
cheers
Rahul
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 30 Sep 2008 at 5:12am
you can do this way also create a forumula noofdays as following :
 
if (month(today) in [1,3,5,7,8,10,12]) then
     31
else if (month(today) in [4,6,9,11]) then
    30
else if (month(today) = 2 and remainder(year(today),2) = 0) then
    29
else
    28;
 
replace today with  table field name (date field)


Edited by Savan - 30 Sep 2008 at 5:14am
Thanks
Savan
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.