Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    9

    Unanswered: Need help with dates

    I need help with Crystal date functions. I have data in Access 2003 that is entered every Friday with that Friday's date. I am trying to create a report in Crystal XI that will do the following:

    If today is Friday, then pull data with today's date. If today is not Friday, then pull data with previous Friday's date.

    Can anyone help me create a formula that will do this?

    Thanks,
    beangrammer

  2. #2
    Join Date
    Jul 2007
    Posts
    54
    My machine with Crystal on is unavailable right now, but from memory there is a function you can use which returns a number representing the day of the week - I think it is Day(Today) - you can use the Crystal Help to find it. You then get something like 1=Sunday, 2=Monday, etc., but please try it out to confirm what number is which day because I can't remember.

    Now to get last Friday all you will need is a formula that says something like:

    Today - Day(Today) - 1

    I put 1 in the above on the assumption that my memory that Sunday = 1, Monday = 2 and so on is right.

    Sorry, but I've got to dash out now. If the above doesn't work for you then please post back and I'll retrieve my machine with Crystal on.

    HTH
    Caspar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •