PC Review


Reply
Thread Tools Rate Thread

Add Days from another table to Date in current table

 
 
MrPaladin
Guest
Posts: n/a
 
      30th Jun 2009

I've tried searching for an answer and I see alot of reply:[Date]+number and
DateAdd("d",number,[Date]) but I cant seem to connect the dots to get the
number I want from another table.

I have two tables. Table1 is called Procedure and it contains a field
called ExpireDays which is a number (representing days). Table2 is called
Class and has a date field called ClassDate and another date feild called
ExpiresDate.

I want to use a form that will automatically calculate the ExpiresDate by
adding the number of days selected from a record in the Procedure table to
the ClassDate entered on the same form.

No matter what expression I have tried I get an error (or nothing at all
changes).

Any help is appreciated... Thankyou
 
Reply With Quote
 
 
 
 
bonnet catherine
Guest
Posts: n/a
 
      30th Jun 2009



"MrPaladin" <(E-Mail Removed)> a écrit dans le message de
groupe de discussion : 995781DE-D774-4EB3-9B82-(E-Mail Removed)...
> I've tried searching for an answer and I see alot of reply:[Date]+number
> and
> DateAdd("d",number,[Date]) but I cant seem to connect the dots to get the
> number I want from another table.
>
> I have two tables. Table1 is called Procedure and it contains a field
> called ExpireDays which is a number (representing days). Table2 is called
> Class and has a date field called ClassDate and another date feild called
> ExpiresDate.
>
> I want to use a form that will automatically calculate the ExpiresDate by
> adding the number of days selected from a record in the Procedure table to
> the ClassDate entered on the same form.
>
> No matter what expression I have tried I get an error (or nothing at all
> changes).
>
> Any help is appreciated... Thankyou


 
Reply With Quote
 
 
 
 
KARL DEWEY
Guest
Posts: n/a
 
      30th Jun 2009

You can do it as a batch using an update query. To have it happen as you do
data entery on a form you need a query that has both tables joined. Both of
the queries must have a common field such as ClassID. Use an On Update event
of the field ,[Class].[ClassDate] in your form.

SET Class.ExpiresDate = DateAdd("d",Procedure.ExpireDays
,[Class].[ClassDate])


"MrPaladin" wrote:

> I've tried searching for an answer and I see alot of reply:[Date]+number and
> DateAdd("d",number,[Date]) but I cant seem to connect the dots to get the
> number I want from another table.
>
> I have two tables. Table1 is called Procedure and it contains a field
> called ExpireDays which is a number (representing days). Table2 is called
> Class and has a date field called ClassDate and another date feild called
> ExpiresDate.
>
> I want to use a form that will automatically calculate the ExpiresDate by
> adding the number of days selected from a record in the Procedure table to
> the ClassDate entered on the same form.
>
> No matter what expression I have tried I get an error (or nothing at all
> changes).
>
> Any help is appreciated... Thankyou

 
Reply With Quote
 
Pieter Wijnen
Guest
Posts: n/a
 
      30th Jun 2009

Normally you would not need the class.expiredays as I see it if a
Procedure's expiry date can't change over time(?), because then you *should*
calculate it when you need it, using a query, a function (even Dlookup).

hth

pieter

"KARL DEWEY" <(E-Mail Removed)> skrev i melding
news:1A94F924-C1EF-46D6-ABDE-(E-Mail Removed)...
> You can do it as a batch using an update query. To have it happen as you
> do
> data entery on a form you need a query that has both tables joined. Both
> of
> the queries must have a common field such as ClassID. Use an On Update
> event
> of the field ,[Class].[ClassDate] in your form.
>
> SET Class.ExpiresDate = DateAdd("d",Procedure.ExpireDays
> ,[Class].[ClassDate])
>
>
> "MrPaladin" wrote:
>
>> I've tried searching for an answer and I see alot of reply:[Date]+number
>> and
>> DateAdd("d",number,[Date]) but I cant seem to connect the dots to get the
>> number I want from another table.
>>
>> I have two tables. Table1 is called Procedure and it contains a field
>> called ExpireDays which is a number (representing days). Table2 is
>> called
>> Class and has a date field called ClassDate and another date feild called
>> ExpiresDate.
>>
>> I want to use a form that will automatically calculate the ExpiresDate by
>> adding the number of days selected from a record in the Procedure table
>> to
>> the ClassDate entered on the same form.
>>
>> No matter what expression I have tried I get an error (or nothing at all
>> changes).
>>
>> Any help is appreciated... Thankyou



 
Reply With Quote
 
MrPaladin
Guest
Posts: n/a
 
      2nd Jul 2009

Thinking over it a bitthe original plan was to allow manager to change the
expiration as needed and not impact previous classes. But it would suit our
needs not to worry about that case and allow the expiration date to be
calc'ed in querie as you suggest.

I'll still add the expected expiration onto the form for ease.

Thank you all for the great responces.

"Pieter Wijnen" wrote:

> Normally you would not need the class.expiredays as I see it if a
> Procedure's expiry date can't change over time(?), because then you *should*
> calculate it when you need it, using a query, a function (even Dlookup).
>
> hth
>
> pieter
>
> "KARL DEWEY" <(E-Mail Removed)> skrev i melding
> news:1A94F924-C1EF-46D6-ABDE-(E-Mail Removed)...
> > You can do it as a batch using an update query. To have it happen as you
> > do
> > data entery on a form you need a query that has both tables joined. Both
> > of
> > the queries must have a common field such as ClassID. Use an On Update
> > event
> > of the field ,[Class].[ClassDate] in your form.
> >
> > SET Class.ExpiresDate = DateAdd("d",Procedure.ExpireDays
> > ,[Class].[ClassDate])
> >
> >
> > "MrPaladin" wrote:
> >
> >> I've tried searching for an answer and I see alot of reply:[Date]+number
> >> and
> >> DateAdd("d",number,[Date]) but I cant seem to connect the dots to get the
> >> number I want from another table.
> >>
> >> I have two tables. Table1 is called Procedure and it contains a field
> >> called ExpireDays which is a number (representing days). Table2 is
> >> called
> >> Class and has a date field called ClassDate and another date feild called
> >> ExpiresDate.
> >>
> >> I want to use a form that will automatically calculate the ExpiresDate by
> >> adding the number of days selected from a record in the Procedure table
> >> to
> >> the ClassDate entered on the same form.
> >>
> >> No matter what expression I have tried I get an error (or nothing at all
> >> changes).
> >>
> >> Any help is appreciated... Thankyou

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to pull <=14 Days, <=30 Days, >30 Days from a date column Ken Microsoft Excel Misc 3 23rd Oct 2009 12:53 AM
Add 7 days to date but also 14 days Ben Microsoft Access Form Coding 1 7th Oct 2008 04:53 PM
HOW TO I SHOW 4 DAYS ON 4 DAYS OFF 4 DAYS ON ETC sueshawn Microsoft Outlook Calendar 2 15th May 2008 10:21 PM
Adding days expired in current year and days remaining in current =?Utf-8?B?cHJlem9uZWRheQ==?= Microsoft Outlook Calendar 1 2nd Feb 2007 02:26 AM
Can Excel add working days to a date to result in another date? =?Utf-8?B?Y3dhbHJ1cw==?= Microsoft Excel Worksheet Functions 1 16th May 2006 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:51 AM.