Ron Cates Posted May 21, 2010 Posted May 21, 2010 Hi all. We enter orders the day after they are sold. I would like to auto populate a field to accurately reflect the date sold. So Tuesday through Friday I need it to populate current date - 1. But the tricky part is that on Mondays I would like it to populate current date - 3 to show that it was sold on Friday. Could someone help me out with a formula to do this? Thanks
Breezer Posted May 21, 2010 Posted May 21, 2010 if you have a field called "CreationDate" which is the day the orders are entered, you could do this for the "DateSold" field: Case ( DayOfWeek(CreationDate)=2; CreationDate-3; CreationDate-1)
Ron Cates Posted May 21, 2010 Author Posted May 21, 2010 I do have a creation date field and this appears to do the trick. Thanks so much for the help :
LaRetta Posted May 21, 2010 Posted May 21, 2010 Then I guess I didn't understand the request because if the date is 5/9 (Sunday), it produces Saturday. I would think you would want Friday. If you want to skip both weekend days then try: CreateDate - 1 - Position ( "12" ; DayOfWeek ( CreateDate ) ; 1 ; 1 )
Recommended Posts
This topic is 5358 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now