Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

AccessTable - Edit Dates

Posted on 2009-06-30
1
Medium Priority
?
193 Views
Last Modified: 2013-11-29
I have a table that lists dates. How would I query a second column that shows the Friday for the week each date falls in to?

Assume each week starts on Saturday and ends on Friday.
Assume Table Name: "tblListDates", FieldName: "DateList"

i.e. My table may have the following dates. (In reality there is 500K records spanning from 1998)
   
Date List      New Column I would like (Shows Friday of every week date falls into.)
1/1/09          1/2/09
1/2/09          1/2/09
1/3/09          1/9/09
1/4/09          1/9/09
1/5/09          1/9/09
1/6/09          1/9/09
2/12/09        2/13/09
2/17/09        2/20/09
5/1/09          5/1/09
5/2/09          5/8/09
5/3/09          5/8/09

Notice how in the new column (Second Column) each date is a Friday. This represents the Friday of the week the date in the first column falls into (Assuming every week starts on Saturday and Ends on Friday.)
0
Comment
Question by:ouestque
[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
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 24750216
select DateList,dateadd("d",6-weekday([DateList]),[DateList]) as NewColumn
from tblListDates


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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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 …

705 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