Print Page | Close Window

Calculate Day number of the year in Crystal Report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16531
Printed Date: 06 May 2024 at 6:02pm


Topic: Calculate Day number of the year in Crystal Report
Posted By: krishreddy
Subject: Calculate Day number of the year in Crystal Report
Date Posted: 22 May 2012 at 9:06pm
Hi,

We are using SAP Crystal Report 2011. Here I am trying to calculate the values like invoice_qty is <183 days and invoice_qty >= 183 days in the year.
So I want to create a field day number of the year like if invoice date is 10thFeb2012 then day number will be 41.
Could you please suggest me how can I get day number of the year.

With Regards,
Krishna Reddy.



Replies:
Posted By: rkrowland
Date Posted: 22 May 2012 at 10:32pm
datediff("d",date(year({table.date}),1,1),{table.date})


Posted By: DBlank
Date Posted: 23 May 2012 at 4:20am
you can use datepart() as well
 
datepart('y',{table.datefield})



Print Page | Close Window