If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
date expression to bring up a weeks worth of records
i have my new data base built but for the love of god can i get the
expression right this. in my query i need, when prompted it asks for a date, and when i put in 21/11/06, i want it to bring up all records for that week( monday to sunday). can anyone 1 help plz. Thank you. Chris |
#2
|
|||
|
|||
date expression to bring up a weeks worth of records
Use a Between criteria with the function Weekday():
Between [InputDate]-Weekday([InputDate])+1 AND [InputDate]+7-Weekday( [InputDate]) Chris wrote: i have my new data base built but for the love of god can i get the expression right this. in my query i need, when prompted it asks for a date, and when i put in 21/11/06, i want it to bring up all records for that week( monday to sunday). can anyone 1 help plz. Thank you. Chris -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200611/1 |
#3
|
|||
|
|||
date expression to bring up a weeks worth of records
hi, thanks for the quick response, but if wont let me use it as its "too
complex" or typed in correctly. any other suggestions plz Thank you "kingston via AccessMonster.com" wrote: Use a Between criteria with the function Weekday(): Between [InputDate]-Weekday([InputDate])+1 AND [InputDate]+7-Weekday( [InputDate]) Chris wrote: i have my new data base built but for the love of god can i get the expression right this. in my query i need, when prompted it asks for a date, and when i put in 21/11/06, i want it to bring up all records for that week( monday to sunday). can anyone 1 help plz. Thank you. Chris -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200611/1 |
#4
|
|||
|
|||
date expression to bring up a weeks worth of records
In your query, this should go in the criteria for the date field. Make sure
to reformat this if the posting is broken up. Additional parentheses may help Access digest it: Between ([InputDate]-Weekday([InputDate])+1) AND ([InputDate]+7-Weekday( [InputDate])) Otherwise, simply use the mathematical comparators =. Also, is your system set up to show dates in the format day/month/year rather than month/day/year? Is this how data is recorded in the table? Chris wrote: hi, thanks for the quick response, but if wont let me use it as its "too complex" or typed in correctly. any other suggestions plz Thank you Use a Between criteria with the function Weekday(): [quoted text clipped - 11 lines] Chris -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200611/1 |
#5
|
|||
|
|||
date expression to bring up a weeks worth of records
On Mon, 27 Nov 2006 09:17:02 -0800, Chris wrote:
i have my new data base built but for the love of god can i get the expression right this. in my query i need, when prompted it asks for a date, and when i put in 21/11/06, i want it to bring up all records for that week( monday to sunday). can anyone 1 help plz. Thank you. Chris Add a new column to your query. WeekOfatePart("ww",[DateField]) As criteria on this column, write: DatePart("ww",[Week of what date? mm/dd/yyyy]) I notice you are using a non-US date format. The date, when prompted, MUST be entered in the US format of month/day/year unless the date is unambiguous. A date of 2/5/2006 is ambiguous. It could be Feb 5 or May 2. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|