UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Date And Week, Access 2010    
 
   
rzw0wr
post Feb 4 2020, 10:16 PM
Post#1



Posts: 370
Joined: 28-March 12
From: Indiana



Problem Solved.

I have a query for a schedule.

I want to show all of the dates in a calendar week.
From Monday to Friday.

I can not figure out which function to use, weekday, datepart or any of the other date functions.


Thank you,
Dale
This post has been edited by rzw0wr: Feb 4 2020, 11:05 PM

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
Doug Steele
post Feb 4 2020, 10:26 PM
Post#2


UtterAccess VIP
Posts: 22,263
Joined: 8-January 07
From: St. Catharines, ON (Canada)


We need more details.

If your table contains a complete date, your WHERE clause could be something like

CODE
WHERE Weekday([YourDateField]) IN (2, 3, 4, 5, 6)

--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 
rzw0wr
post Feb 4 2020, 10:36 PM
Post#3



Posts: 370
Joined: 28-March 12
From: Indiana


Doug,
This what I have in my query now.

The WHERE statement you sent shows all of the scheduled dates.

CODE
SELECT tblWorkPerformed.tblWorkPreformed_ID, tblCustomerName.FirstName, tblCustomerName.LastName, tblWorkPerformed.Work, tblWorkPerformed.WorkDate
FROM tblCustomerName INNER JOIN tblWorkPerformed ON tblCustomerName.tblCustomerName_ID = tblWorkPerformed.Customer_ID
WHERE Weekday([WorkDate]) IN (2, 3, 4, 5, 6);

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
WildBird
post Feb 4 2020, 11:06 PM
Post#4


UtterAccess VIP
Posts: 3,724
Joined: 19-August 03
From: Auckland, Little Australia


I am about to head out, but what I think the OP wants is a group by a particular week?

Week 27 for example? Is this correct? The SQL code now shows all those for Monday to Friday across all date ranges.


--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 
rzw0wr
post Feb 5 2020, 10:30 AM
Post#5



Posts: 370
Joined: 28-March 12
From: Indiana


I got it all worked out.

I have the user enter a From date and a To date then search with a BETWEEN function.


Thanks for the replies,

Dale

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    5th April 2020 - 01:37 AM