Solved

MS Access Query help, querying for certain days between 2 dates.

Posted on 2009-07-14
3
262 Views
Last Modified: 2012-05-07
I have a query in Access that queries Oracle tables and pulls data based on a specified date range...start date and end date.  What I would like to be able to do, without using VBA if possible, is to use the query I currently have to pull data for a date range, but specify only certain weekdays that I want, i.e Mon-Thur.

So when a user enters a start date and an end date, the query will return data between those dates for Monday through Thursday only.  Is this possible?  If not I will just write the VBA code to do it instead...thanks.
0
Comment
Question by:rgn2121
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:onethreefour
ID: 24856710
Could you use the to_char function?  
http://www.easywebtech.com/Oracle_Day_Of_Week.html

Convert your date field to a day of the week numerical equiv with to_char(DATEFIELD, 'D')...
....where to_char(DATEFIELD, 'D') > 1 and to_char(DATEFIELD, 'D') < 5....
Forgive my syntax, I am a mysql guy not oracle  ;]
0
 
LVL 4

Accepted Solution

by:
Nicolaze earned 500 total points
ID: 24856711
If the table you want to query contains the field fdate for the date, you write the following

SELECT Table.*
FROM Table
WHERE (((Table.fdate)>=[enter date1] And (Table1.fdate)<=[enter date2]) AND ((Weekday([fdate])) Between 1 And 4));
0
 
LVL 12

Author Closing Comment

by:rgn2121
ID: 31603596
perfect...thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 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