How to find weeknumber when my table contains a date

T

Traima

Hi all you experts, I have a basic access question. I have a table with
orders, and also order dates. I would like to make a summary per week, but my
table does not include the weeknumber. Can I make a function formula somehow
to calculate the weeknumber?
 
M

Maurice

Traima;

Create a query using your table as the source. Add the necessary fields to
the querygrid. Now create a new field to the querygrid as follows:

description: DatePart("ww",[datefield],0,2)

where description should be a word you'd like to use as a columnheader for
your output. The datefield should be the datefield from your table which you
want to extract the weeknumber from.

Run the query and you should have an extra field in your view containing
weeknumbers based on the datefield you have chosen.

hth
 
T

Traima

Hi Maurice,
Thanks a lot for your help. I now have the weeknumbers in my query. The only
thing is that I have to select the wanted weeknumber in a parameter query
when I run my query. How can I run the query with all weeknumbers?

Again, thanks a lot for helping me!


Traima

Maurice said:
Traima;

Create a query using your table as the source. Add the necessary fields to
the querygrid. Now create a new field to the querygrid as follows:

description: DatePart("ww",[datefield],0,2)

where description should be a word you'd like to use as a columnheader for
your output. The datefield should be the datefield from your table which you
want to extract the weeknumber from.

Run the query and you should have an extra field in your view containing
weeknumbers based on the datefield you have chosen.

hth
--
Maurice Ausum


Traima said:
Hi all you experts, I have a basic access question. I have a table with
orders, and also order dates. I would like to make a summary per week, but my
table does not include the weeknumber. Can I make a function formula somehow
to calculate the weeknumber?
 
T

Traima

Maurice,

I actually figured it out. I put my formula in the wrong field.

Thanks again!

Traima said:
Hi Maurice,
Thanks a lot for your help. I now have the weeknumbers in my query. The only
thing is that I have to select the wanted weeknumber in a parameter query
when I run my query. How can I run the query with all weeknumbers?

Again, thanks a lot for helping me!


Traima

Maurice said:
Traima;

Create a query using your table as the source. Add the necessary fields to
the querygrid. Now create a new field to the querygrid as follows:

description: DatePart("ww",[datefield],0,2)

where description should be a word you'd like to use as a columnheader for
your output. The datefield should be the datefield from your table which you
want to extract the weeknumber from.

Run the query and you should have an extra field in your view containing
weeknumbers based on the datefield you have chosen.

hth
--
Maurice Ausum


Traima said:
Hi all you experts, I have a basic access question. I have a table with
orders, and also order dates. I would like to make a summary per week, but my
table does not include the weeknumber. Can I make a function formula somehow
to calculate the weeknumber?
 
M

Maurice

Your welcome :)
--
Maurice Ausum


Traima said:
Maurice,

I actually figured it out. I put my formula in the wrong field.

Thanks again!

Traima said:
Hi Maurice,
Thanks a lot for your help. I now have the weeknumbers in my query. The only
thing is that I have to select the wanted weeknumber in a parameter query
when I run my query. How can I run the query with all weeknumbers?

Again, thanks a lot for helping me!


Traima

Maurice said:
Traima;

Create a query using your table as the source. Add the necessary fields to
the querygrid. Now create a new field to the querygrid as follows:

description: DatePart("ww",[datefield],0,2)

where description should be a word you'd like to use as a columnheader for
your output. The datefield should be the datefield from your table which you
want to extract the weeknumber from.

Run the query and you should have an extra field in your view containing
weeknumbers based on the datefield you have chosen.

hth
--
Maurice Ausum


:

Hi all you experts, I have a basic access question. I have a table with
orders, and also order dates. I would like to make a summary per week, but my
table does not include the weeknumber. Can I make a function formula somehow
to calculate the weeknumber?
 

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