Query for specific days within a date range in Crystal Reports XI

Posted on 2011-10-05
Last Modified: 2012-05-12
Hello Experts,
I am working on a Crystal Report (version XI) that queries an Oracle database. The report is pulling records from the database that have a date field that falls within a specified date range. I need to pull these records within the specified date range, but only for dates that fall on a Monday, Tuesday, or Wednesday. Is it possible to query for specific days in the record selection statement?  Thanks.
Question by:jsmith08
    LVL 18

    Accepted Solution

    Use the DatePart function
    DatePart("w", yourdatefield) IN [2,3,4]

    w = weekday
    crystal uses 1-7 to describe the days of the week,  You may have to adjust the 2,3,4 to get the right days depending on how you have the firstDayOfWeek configured within CR

    Author Closing Comment

    Perfect!!  Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now