Finding a date

B

Bunky

I need to be able to always find the prior weeks Monday date. What is the
best way to proceed?

Thank you in advance!
 
J

Jerry Whittle

Try something like this in a query with the proper field name:

ThePreviousMonday: [TheDateField]-DatePart("w",[TheDateField],2)-6

Jerry Whittle
 
B

Bunky

Jerry,

Wow! Now I understand somewhat but for my understanding could I impose on
you to tell why this works? You see, I am going to need to come up with
several monday dates; this weeks, one week back, two weeks back etc. I
thought I would be able to figure it out it I used you code as a template and
the help but I cannot get it through my thick head.

Kent

Jerry Whittle said:
Try something like this in a query with the proper field name:

ThePreviousMonday: [TheDateField]-DatePart("w",[TheDateField],2)-6

Jerry Whittle

Bunky said:
I need to be able to always find the prior weeks Monday date. What is the
best way to proceed?

Thank you in advance!
 
D

Douglas J. Steele

Once you know this week's Monday, use the DateAdd function to get Monday of
previous weeks. (DateAdd("w", -1, ...), DateAdd("w", -2, ...) and so on)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
Jerry,

Wow! Now I understand somewhat but for my understanding could I impose on
you to tell why this works? You see, I am going to need to come up with
several monday dates; this weeks, one week back, two weeks back etc. I
thought I would be able to figure it out it I used you code as a template
and
the help but I cannot get it through my thick head.

Kent

Jerry Whittle said:
Try something like this in a query with the proper field name:

ThePreviousMonday: [TheDateField]-DatePart("w",[TheDateField],2)-6

Jerry Whittle

Bunky said:
I need to be able to always find the prior weeks Monday date. What is
the
best way to proceed?

Thank you in advance!
 
B

Bunky

Doug,

Thank you!

Douglas J. Steele said:
Once you know this week's Monday, use the DateAdd function to get Monday of
previous weeks. (DateAdd("w", -1, ...), DateAdd("w", -2, ...) and so on)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
Jerry,

Wow! Now I understand somewhat but for my understanding could I impose on
you to tell why this works? You see, I am going to need to come up with
several monday dates; this weeks, one week back, two weeks back etc. I
thought I would be able to figure it out it I used you code as a template
and
the help but I cannot get it through my thick head.

Kent

Jerry Whittle said:
Try something like this in a query with the proper field name:

ThePreviousMonday: [TheDateField]-DatePart("w",[TheDateField],2)-6

Jerry Whittle

:

I need to be able to always find the prior weeks Monday date. What is
the
best way to proceed?

Thank you in advance!
 
B

bruha viki

Bunky said:
Jerry,

Wow! Now I understand somewhat but for my understanding could I impose on
you to tell why this works? You see, I am going to need to come up with
several monday dates; this weeks, one week back, two weeks back etc. I
thought I would be able to figure it out it I used you code as a template
and
the help but I cannot get it through my thick head.

Kent

Jerry Whittle said:
Try something like this in a query with the proper field name:

ThePreviousMonday: [TheDateField]-DatePart("w",[TheDateField],2)-6

Jerry Whittle

Bunky said:
I need to be able to always find the prior weeks Monday date. What is
the
best way to proceed?

Thank you in advance!
 
Top