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!

Return tomorrows records if Monday thru Thursday

Status
Not open for further replies.

pleashelp

Technical User
Feb 27, 2002
97
US
I am using CR XI. This is what I want to do. I have customers and their appointment dates. I am trying to get a list of appointments for the following day. But I only have appointments on Monday thru Friday. So, if tomorrow is Tuesday thru Friday, I want to return my appointments for the next day. If tomorrow is a Saturday or Sunday, then I want to return my appointments with Monday's date. Can anyone help me with this? Thanks!
 
Hi,
You can use the DayOfWeek function in a selection formula to do that, something like:
Code:
If DayOfWeek (currentdate) = 6 [COLOR=green]//Friday[/color]
 then 
  {Table.ApptDateField} = currentdate + 3 [COLOR=green]//Get Monday Appts[/color]
 else
  if  DayOfWeek (currentdate + 1) = 7 [COLOR=green]//Saturday[/color]
   Then
      {Table.ApptDateField} = currentdate + 2 [COLOR=green]//Get Monday Appts.[/color]
Else
{Table.ApptDateField} = currentdate + 1 [COLOR=green]//Get Next day's Appts.[/color]





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks! I just put that into my slection formula, and it worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top