A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filtering by week



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2008, 10:08 AM posted to microsoft.public.access.queries
Fredrik
external usenet poster
 
Posts: 42
Default Filtering by week

Hello!

I have a form with a subform showing orders. Each post have a date
(loadingdate).
In the mainform I have a Textbox called "tbxWeek" and a commandbutton
"cmdWeek". When I write a weeknumber and press the commandbutton I want the
subform to only show the orders for the given week.

The subform is showing a query so the real question is, what should i write
in the query?

Thanks!
  #2  
Old July 7th, 2008, 10:41 AM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Filtering by week


In the query put this:

wknum: format([loadingdate], "w")

This will provide the week number. Then put a filter in the criteria row for
this field that references the text box.


"Fredrik" wrote:

Hello!

I have a form with a subform showing orders. Each post have a date
(loadingdate).
In the mainform I have a Textbox called "tbxWeek" and a commandbutton
"cmdWeek". When I write a weeknumber and press the commandbutton I want the
subform to only show the orders for the given week.

The subform is showing a query so the real question is, what should i write
in the query?

Thanks!

  #3  
Old July 7th, 2008, 11:28 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Filtering by week

Make that
wknum: format([loadingdate], "ww")
as "w" will give you the day of the week
based on Sunday being 1 and Saturday being 7.
--
KARL DEWEY
Build a little - Test a little


"scubadiver" wrote:


In the query put this:

wknum: format([loadingdate], "w")

This will provide the week number. Then put a filter in the criteria row for
this field that references the text box.


"Fredrik" wrote:

Hello!

I have a form with a subform showing orders. Each post have a date
(loadingdate).
In the mainform I have a Textbox called "tbxWeek" and a commandbutton
"cmdWeek". When I write a weeknumber and press the commandbutton I want the
subform to only show the orders for the given week.

The subform is showing a query so the real question is, what should i write
in the query?

Thanks!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.