473,666 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find Sunday and Saturday

Given a selected date, how do I find the date of the Sunday and Saturday of
the week that that date is in?

Thanks!

Jerry
Nov 13 '05 #1
2 6259
You can use the Weekday function which, by default, returns 1 for Sunday, 2
for Monday and so on up to 7 for Saturday. Knowing which day it is, you can
easily figure out how many days you need to subtract for the previous
Sunday, or add for the following Saturday.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Jerry" <pl****@nospam. forme> wrote in message
news:cS******** ********@newsre ad3.news.atl.ea rthlink.net...
Given a selected date, how do I find the date of the Sunday and Saturday of the week that that date is in?

Thanks!

Jerry

Nov 13 '05 #2
"Jerry" <pl****@nospam. forme> wrote in
news:cS******** ********@newsre ad3.news.atl.ea rthlink.net:
Given a selected date, how do I find the date of the Sunday
and Saturday of the week that that date is in?

Thanks!

Jerry

The format() function will return the day of week as a number 1 to
7 when given the "w" option. To get the saturday, use the dateadd()
function to increase the date by the number needed.

It's all in the help files.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3206
by: Eric Linders | last post by:
Hello, Today is Thursday, August 18, 2004. I would like to have a variable that stores the date this coming Sunday (even if today happened to be Sunday) in YYY-MM-DD format. I also need a variable that will store the date this past Monday (even if today happens to be Monday) also in YYY-MM-DD format. So, the end result is that, for this week (today is 2004-08-18) I would have the following two variables:
11
5729
by: Matt | last post by:
My ASP page allows the user select the date, and it will display the report during that week of that date. My question is when the program query database, I need to know the beginning date and ending date of that week. Any ideas??
0
291
by: Jerry | last post by:
Given a week number of a selected year, how do I find the dates of the Sunday and Saturday of that week? Thanks! Jerry
3
3380
by: Jerry | last post by:
How do I find the dates of the Sunday and Saturday of a week if I have the week number of a selected year? Thanks! Jerry
1
1733
by: rock72 | last post by:
Hello Everyone, Can you tell me how to produce a query that when Login Date (entry) is Sunday. First, check if the Sunday Date occur on 7th day of his duty. Example 1: Login Date no. of wk days Remark 11/01/04 1
5
2365
by: Drum2001 | last post by:
Currently I am running the following query: SELECT DateFilter.Employee, DateFilter.TimeTypeIn, sectodur(IIf(Sum(DateDiff("s",,))-40*60*60>0,Sum(DateDiff("s",,))-40*60*60,0)) AS Overtime, DateAdd("d",-Weekday(),)+1 AS WeekOf FROM DateFilter GROUP BY DateFilter.Employee, DateFilter.TimeTypeIn, DateAdd("d",-Weekday(),)+1 HAVING (((DateFilter.TimeTypeIn)="Regular"));
9
3240
by: griemer | last post by:
Hi every one, Is there a way to calculate the timestamp of 00:00:00 last Sunday. For me, this is the begin of the current week.. Or, how old is this week, in seconds Any ideas? Regards,
6
2557
RamananKalirajan
by: RamananKalirajan | last post by:
Can any one please help me out in calculating the no of weekdays between two givendays using Javascripts I tried in many way but I cant get the solution. The date format I am using is DD-MON-YYYY. Please help me out
3
2347
by: pchaitanya | last post by:
I have selected some list of valid dates to a label. now i need to find first day among the given dates from label contrl i got dates from calender control by clicking for entire week.. that is i have dates from sunday to saturday and I have to find which date is sunday......
0
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8360
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8784
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.