Solved

AccessTable - Edit Dates

Posted on 2009-06-30
1
181 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
1 Comment
 
LVL 120

Accepted Solution

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


0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

813 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

18 Experts available now in Live!

Get 1:1 Help Now