Print Page | Close Window

Formula Help - Group by week

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22684
Printed Date: 02 May 2024 at 8:56pm


Topic: Formula Help - Group by week
Posted By: NCGOV
Subject: Formula Help - Group by week
Date Posted: 24 Oct 2018 at 10:28am
I have the following formula to group by week starting on Friday. Currently it is set to convert the date "totext". How can I change the formula to leave as a date rather than text? This way I can run multiple years and the week groups will be in chronological order. TIA

local datetimevar start;
local datetimevar end;
start:= {unithist.onduty}-weekday({unithist.onduty},6)+1;
End:=start+6;
totext(start,"MM/dd/yy") & " - " & totext(end, "MM/dd/yy")



Print Page | Close Window