Filtering by week

F

Fredrik

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!
 
S

scubadiver

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.
 
K

KARL DEWEY

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 said:
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 said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top