If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Extending a Date
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? |
#2
|
|||
|
|||
Extending a Date
On Mon, 6 Nov 2006 14:10:04 -0800, 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. 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] |
#3
|
|||
|
|||
Extending a Date
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. -- Marsh MVP [MS Access] |
#4
|
|||
|
|||
Extending a Date
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" wrote: 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. -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
Extending a Date
On Mon, 6 Nov 2006 17:27:01 -0800, Nanette
wrote: 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] |
#6
|
|||
|
|||
Extending a Date
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] Nanette wrote: 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" wrote: 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. |
#7
|
|||
|
|||
Extending a Date
Thanks to the both of you Marshall and John.
I have my date extending working and appreicated the additional suggestions. Nanette "Marshall Barton" wrote: 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] Nanette wrote: 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" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|