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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Geeting number od days for particular month

Status
Not open for further replies.

crysln

Technical User
Jun 24, 2009
9
BH
Hi
I am using crystal reports 11. I want to know is there any function which will give me number of days in particular month.
I want to write a formula in which i need to divide by the days of that particular month.
Example: If it is august then divide by 30 if september then divide by 31 ans so on

Please Help
 
You can use DateDiff to find the number of days between the first of a month and the first of the next month (which can be found using DateAdd for months). Subtract one and that is your answer, and you can put it in a formula field that you can then reference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
day(dateserial(year(currentdate),month(currentdate)+1,1)-1)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top