DateAdd using "w"

  • Thread starter Thread starter RB
  • Start date Start date
R

RB

I am trying to create a query that adds two week days to a
date. I have tried to use DateAdd("w", 2, [ShipDate]) in
my query, but this simply adds two calendar days. Is there
a way to get this feature to work in Access? It seems like
I have followed the instructions in the help file but it's
not working! Thanks!

RB
 
Dear RB:

You will need to use a DateAdd function to add a variable number of
days to the ShipDate. You can use the DatePart function to determine
which day of the week the ShipDate is. I suggest you use the value
returned from this function, an integer 1-7, in a Choose function to
return the number of days to add.

As this appears to be a school assignment, I'll leave the details to
your creativity. I suggest you look up the DatePart and Choose
functions in online help and craft the solution from there. A liberal
use of the immediate pane would be in order, testing each step of the
process as you build a solution.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Thanks for the tip. I chose to use the weekday function
instead. And no, it isn't a school assignment. Thanks for
the help anyways.


-----Original Message-----
Dear RB:

You will need to use a DateAdd function to add a variable number of
days to the ShipDate. You can use the DatePart function to determine
which day of the week the ShipDate is. I suggest you use the value
returned from this function, an integer 1-7, in a Choose function to
return the number of days to add.

As this appears to be a school assignment, I'll leave the details to
your creativity. I suggest you look up the DatePart and Choose
functions in online help and craft the solution from there. A liberal
use of the immediate pane would be in order, testing each step of the
process as you build a solution.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


I am trying to create a query that adds two week days to a
date. I have tried to use DateAdd("w", 2, [ShipDate]) in
my query, but this simply adds two calendar days. Is there
a way to get this feature to work in Access? It seems like
I have followed the instructions in the help file but it's
not working! Thanks!

RB

.
 
Back
Top