Using between with week numbers

D

DevourU

Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas or
thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS
 
B

Br@dley

DevourU said:
Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas
or thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS

What do you mean "it's failing"?

Do you need to include the year value as well?

eg.

200523
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
 
D

DevourU

Sorry 'bout that. I believe yyyyww will do the trick, but I am not having
success with DatePart.

-JS

Br@dley said:
DevourU said:
Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas
or thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS

What do you mean "it's failing"?

Do you need to include the year value as well?

eg.

200523
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
 
D

DevourU

Format works, but looks like 200550 and 20061. How would you get 20061 to
look like 200601?

-JS

DevourU said:
Sorry 'bout that. I believe yyyyww will do the trick, but I am not having
success with DatePart.

-JS

Br@dley said:
DevourU said:
Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas
or thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS

What do you mean "it's failing"?

Do you need to include the year value as well?

eg.

200523
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
 
D

Douglas J. Steele

You may have to use

Format(MyDateField, "yyyy") & Format(DatePart("ww", MyDateField), "00")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DevourU said:
Format works, but looks like 200550 and 20061. How would you get 20061 to
look like 200601?

-JS

DevourU said:
Sorry 'bout that. I believe yyyyww will do the trick, but I am not having
success with DatePart.

-JS

Br@dley said:
DevourU wrote:
Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas
or thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS

What do you mean "it's failing"?

Do you need to include the year value as well?

eg.

200523
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
 
D

DevourU

Looks like that'll do the trick. Thankx ya'll.

-JS

Douglas J. Steele said:
You may have to use

Format(MyDateField, "yyyy") & Format(DatePart("ww", MyDateField), "00")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DevourU said:
Format works, but looks like 200550 and 20061. How would you get 20061 to
look like 200601?

-JS

DevourU said:
Sorry 'bout that. I believe yyyyww will do the trick, but I am not
having success with DatePart.

-JS

DevourU wrote:
Is it possible to use between with calendar week numbers? Below is my
expression, but is failing with the new year coming. Any other ideas
or thoughts? TIA!

IIf([NowWeek] Between [Startweek] And [Endweek],[NowWeek],0)

-JS

What do you mean "it's failing"?

Do you need to include the year value as well?

eg.

200523
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
 
Top