Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    64

    Unanswered: using IIf statements in report then sort..

    I post this before, did'nt get a reply so I will ask differently.

    Using this expression from a query to pull within a range of dates using a field with both date and times.
    Like;GroupDate: Format(DateAdd("d",IIf(([startdatetime]-Int([startdatetime]))<0.25,-1,0),[startdatetime]),"Long Date") in ascending order from the query it's sorts correctly. But it will not sort in ascending order using a report as the "GroupDate" will be the grouping field.

    please advise

  2. #2
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    15
    I think I know what you are trying to say. Try this see if it helps you.

    The query has it's own sorting options just as a report has it's own sorting options. If you sort it one way in a query it doesn't necessarily sort the sam way on the report if the same query is used.

    Go into the reports design view. From the menu bar select View\Sorting and Grouping . Select the field/s and sort order and try previewing the report again.

    Hope this helps.

  3. #3
    Join Date
    Aug 2003
    Posts
    64
    I tried this, still my records not sorting by date. They are sorting by weekdays like; Friday, Monday etc. I need to sort like from a range when I input 01/01/04 to 01/31/04 sorted by my entry. But still show my format "Long Date".

    please advise.

  4. #4
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    15
    One thing that you could try is add another field in your query which is the exactly the same date that you want to sort on without the formating to long date. Add the field to your report and set it's Visible property to False. Then do the sorting on this field.

  5. #5
    Join Date
    Aug 2003
    Posts
    64
    Sorry, this way not working per your suggestion.
    Any other ideas?

    Thanks for your time

Posting Permissions

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