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

define first day of last week 1

Status
Not open for further replies.

CFBaber

Programmer
Feb 11, 2002
6
US
I need to define the first business day of last week and be able to sum month to date values for the month that the first day of last week falls in. The business only does business on days it is open so the first business day of a holiday week may be on a Tuesday.

Thanks for any help!
 
This should help:


And this should get you last Monday:

currentdate-(DayOfWeek(CurrentDate)-5)

And this gets you the start of the month:

date(year(currentdate), month(currentdate),1)

Hardcode the holidays and adjust as required, or you might use the crystal supplied bussinessdays UFL to help in this (available for download).

Some work to be done yet...

-k kai@informeddatadecisions.com
 
Try this:

Minimum(LastFullWeek)

This will return a Sunday. If you want to start with Monday just add 1 to it. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Thanks to both of you! I can make this work
 
Purdy slick, dgillz... I didn't realize that you could use a minimum there.

I always write my own day/week functions these days because I've been burned in the past with either bad functions, or faulty historical instance viewing in CE, I guess it's time to show some faith again...

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top