Extending a Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.

How should this work?
 
I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.

How should this work?

YOu're multiplying by whatever value is in the field NAMED [7].

If you want to add InternalLTW weeks to the date, I'd suggest

ExtendedDate: DateAdd("ww", [InternalLTW], [DateEntered])

or

ExtendedDate: DateAdd("D", 7 * [InternalLTW], [DateEntered])


John W. Vinson[MVP]
 
Nanette said:
I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.


Except for the extraneous = at the beginning, it should
work. However, it depends on how a date field is handeled
internally, Better would be :

ExtendedDate: DateAdd("ww", [InternalLTW], DateEntered)

Note that [InternalLTW] is a really ugly name for a field.
 
Hi Marshall,

I tried your suggestion and the other one from John and now I am getting
#Name!

I am putting this formula in the Control Source of a text label in a form.
Is this correct place to put it or should it go into the table?

Thanks for the hint about the ugly name. It means Internal Lead Time in
Weeks. Being new at naming, would ILTW be better?

Marshall Barton said:
Nanette said:
I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.


Except for the extraneous = at the beginning, it should
work. However, it depends on how a date field is handeled
internally, Better would be :

ExtendedDate: DateAdd("ww", [InternalLTW], DateEntered)

Note that [InternalLTW] is a really ugly name for a field.
 
I am putting this formula in the Control Source of a text label in a form.
Is this correct place to put it or should it go into the table?

It certainly cannot and should not go into a query.

You can put a calculated expression a couple of places. One would be
to put it into a vacant Field cell in a Query, in which case you
precede the expression with a new fieldname, ending with a colon:

ExtendedDate: DateAdd("ww", [InternalLTW], [DateEntered])

Or, you can put it into the Control Source of a Form or Report
textbox, in which case you do NOT use a fieldname, but use an equals
sign instead:

=DateAdd("ww", [InternalLTW], [DateEntered])


John W. Vinson[MVP]
 
You can use whatever name makes sense to you and any other
folks that might have to modify your application. My point
was directed more at the use of the period in the name.
Best practice is to avoid using anything except alphanumeric
characters. ILTW would be a very short name or
InternalLeadTimeWeeks if you don't mind long names or
something in between.

You get a #Name error when Access can not find an item name
used in the expression. In this case you have two names,
[InternalLTW] and DateEntered, one of which is undefined or
maybe just misspelled. The names must be the name of
another control (text box, etc) on the form or the name of a
field in the form's record source table/query.
--
Marsh
MVP [MS Access]

I tried your suggestion and the other one from John and now I am getting
#Name!

I am putting this formula in the Control Source of a text label in a form.
Is this correct place to put it or should it go into the table?

Thanks for the hint about the ugly name. It means Internal Lead Time in
Weeks. Being new at naming, would ILTW be better?

Marshall Barton said:
Nanette said:
I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.


Except for the extraneous = at the beginning, it should
work. However, it depends on how a date field is handeled
internally, Better would be :

ExtendedDate: DateAdd("ww", [InternalLTW], DateEntered)

Note that [InternalLTW] is a really ugly name for a field.
 
Thanks to the both of you Marshall and John.

I have my date extending working and appreicated the additional suggestions.

Nanette

Marshall Barton said:
You can use whatever name makes sense to you and any other
folks that might have to modify your application. My point
was directed more at the use of the period in the name.
Best practice is to avoid using anything except alphanumeric
characters. ILTW would be a very short name or
InternalLeadTimeWeeks if you don't mind long names or
something in between.

You get a #Name error when Access can not find an item name
used in the expression. In this case you have two names,
[InternalLTW] and DateEntered, one of which is undefined or
maybe just misspelled. The names must be the name of
another control (text box, etc) on the form or the name of a
field in the form's record source table/query.
--
Marsh
MVP [MS Access]

I tried your suggestion and the other one from John and now I am getting
#Name!

I am putting this formula in the Control Source of a text label in a form.
Is this correct place to put it or should it go into the table?

Thanks for the hint about the ugly name. It means Internal Lead Time in
Weeks. Being new at naming, would ILTW be better?

Marshall Barton said:
Nanette wrote:

I'm trying to extend a date which is based on a dated in one field and a
number of weeks in another field.

When I entered this:
=ExtendedDate:[DateEntered]+[InternalLTW]*[7]

I was told that I entered an operand without an operator.

Since the InternalLTW is in weeks, I added the multiplication of 7.


Except for the extraneous = at the beginning, it should
work. However, it depends on how a date field is handeled
internally, Better would be :

ExtendedDate: DateAdd("ww", [InternalLTW], DateEntered)

Note that [InternalLTW] is a really ugly name for a field.
 
Back
Top