From: zyus on
I have a date field [fstrlsedt] and a number field [prd].

The number field is actually refering to number of months.

How to put an expression to find a new date by adding [fstrlsedt] with the
number of months [prd]
From: PieterLinden via AccessMonster.com on
zyus wrote:
>I have a date field [fstrlsedt] and a number field [prd].
>
>The number field is actually refering to number of months.
>
>How to put an expression to find a new date by adding [fstrlsedt] with the
>number of months [prd]

Hmm... the DateAdd function sounds awfully promising!!! Create an unbound
control and use something like

DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd"))

Awfully descriptive control names... I hope you never give someone your
database to work on...

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201005/1

From: zyus on
What i'm expecting is to get new date as follow

Assume [fstrlsedt] = "01-01-2010" and [prd]=12

my new date will be "01-01-2011"



"PieterLinden via AccessMonster.com" wrote:

> zyus wrote:
> >I have a date field [fstrlsedt] and a number field [prd].
> >
> >The number field is actually refering to number of months.
> >
> >How to put an expression to find a new date by adding [fstrlsedt] with the
> >number of months [prd]
>
> Hmm... the DateAdd function sounds awfully promising!!! Create an unbound
> control and use something like
>
> DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd"))
>
> Awfully descriptive control names... I hope you never give someone your
> database to work on...
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access/201005/1
>
> .
>
From: GP George on
That's exactly what Pieter's suggestion should return, so I'm wondering what
happened when you tried it?



"zyus" <zyus(a)discussions.microsoft.com> wrote in message
news:142932EF-CD8B-4409-9907-0C0BB9877858(a)microsoft.com...
> What i'm expecting is to get new date as follow
>
> Assume [fstrlsedt] = "01-01-2010" and [prd]=12
>
> my new date will be "01-01-2011"
>
>
>
> "PieterLinden via AccessMonster.com" wrote:
>
>> zyus wrote:
>> >I have a date field [fstrlsedt] and a number field [prd].
>> >
>> >The number field is actually refering to number of months.
>> >
>> >How to put an expression to find a new date by adding [fstrlsedt] with
>> >the
>> >number of months [prd]
>>
>> Hmm... the DateAdd function sounds awfully promising!!! Create an
>> unbound
>> control and use something like
>>
>> DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd"))
>>
>> Awfully descriptive control names... I hope you never give someone your
>> database to work on...
>>
>> --
>> Message posted via AccessMonster.com
>> http://www.accessmonster.com/Uwe/Forums.aspx/access/201005/1
>>
>> .
>>
From: zyus on
When i put DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd"))
in my query error of "Undefined function "me.controls" in expression

Then i changed to DateAdd("m",[fstrlsedt],[prd]) but the result is not correct

eg the [fstrlsedt]=30/04/2010 and [prd]=60 and the was new date = 28/04/5258


"GP George" wrote:

> That's exactly what Pieter's suggestion should return, so I'm wondering what
> happened when you tried it?
>
>
>
> "zyus" <zyus(a)discussions.microsoft.com> wrote in message
> news:142932EF-CD8B-4409-9907-0C0BB9877858(a)microsoft.com...
> > What i'm expecting is to get new date as follow
> >
> > Assume [fstrlsedt] = "01-01-2010" and [prd]=12
> >
> > my new date will be "01-01-2011"
> >
> >
> >
> > "PieterLinden via AccessMonster.com" wrote:
> >
> >> zyus wrote:
> >> >I have a date field [fstrlsedt] and a number field [prd].
> >> >
> >> >The number field is actually refering to number of months.
> >> >
> >> >How to put an expression to find a new date by adding [fstrlsedt] with
> >> >the
> >> >number of months [prd]
> >>
> >> Hmm... the DateAdd function sounds awfully promising!!! Create an
> >> unbound
> >> control and use something like
> >>
> >> DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd"))
> >>
> >> Awfully descriptive control names... I hope you never give someone your
> >> database to work on...
> >>
> >> --
> >> Message posted via AccessMonster.com
> >> http://www.accessmonster.com/Uwe/Forums.aspx/access/201005/1
> >>
> >> .
> >>
 |  Next  |  Last
Pages: 1 2
Prev: Deleting records from a table
Next: VBA in Access 2007