PC Review


Reply
Thread Tools Rate Thread

Calculated field

 
 
LoriP
Guest
Posts: n/a
 
      12th May 2010
I need to calculate many fields based on one start date and I need the
calculations to count by month.
For example first visit is 4/25/2010
The first calculated field must be 5/25/2010 +/- 7 days
This is the first time I've had to do a calculated field where the next
visit must be the exact day of the next month and not just the generic "30
days" Is there an easy way to do this?
Thank you
Lori
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      12th May 2010
Hi,

Go to online help and look for DATESERIAL function. I think that should
help you out.

"LoriP" wrote:

> I need to calculate many fields based on one start date and I need the
> calculations to count by month.
> For example first visit is 4/25/2010
> The first calculated field must be 5/25/2010 +/- 7 days
> This is the first time I've had to do a calculated field where the next
> visit must be the exact day of the next month and not just the generic "30
> days" Is there an easy way to do this?
> Thank you
> Lori

 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      12th May 2010
LoriP wrote:
> I need to calculate many fields based on one start date and I need the
> calculations to count by month.
> For example first visit is 4/25/2010
> The first calculated field must be 5/25/2010 +/- 7 days


You mean you want it to result in a range of dates? That's two fields,
not one. I think I see what you're saying: you want the result to be
obtained by changing the "4" to a "5"? Or are you saying you actually
want to add 1 month? The DateAdd() function gives you the abiility to
add specific date parts. Since months have varying lengths, you'll need
to test for unexpected results. See below

> This is the first time I've had to do a calculated field where the
> next visit must be the exact day of the next month and not just the
> generic "30 days" Is there an easy way to do this?


Probably, but you'll need to tell us what results you want if the first
visit is 1/31/2011 or 5/31/2010

--
HTH,
Bob Barrows


 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      12th May 2010
Your calculated field cannot be be 5/25/2010 +/- 7 days. It must be a
single date.

I think you can use the DateAdd function.

Next_Appointment: DateAdd("m", 1, [start date])

If the following month has less days, February, and your start date is
greater than following month, the date will be the last day of the month.
[start date] Next_Appointment
1/31/2010 2/28/2010


--
Build a little, test a little.


"LoriP" wrote:

> I need to calculate many fields based on one start date and I need the
> calculations to count by month.
> For example first visit is 4/25/2010
> The first calculated field must be 5/25/2010 +/- 7 days
> This is the first time I've had to do a calculated field where the next
> visit must be the exact day of the next month and not just the generic "30
> days" Is there an easy way to do this?
> Thank you
> Lori

 
Reply With Quote
 
LoriP
Guest
Posts: n/a
 
      12th May 2010
Thanks Karl, that was exactly the simple answer I was looking for and it works.

"KARL DEWEY" wrote:

> Your calculated field cannot be be 5/25/2010 +/- 7 days. It must be a
> single date.
>
> I think you can use the DateAdd function.
>
> Next_Appointment: DateAdd("m", 1, [start date])
>
> If the following month has less days, February, and your start date is
> greater than following month, the date will be the last day of the month.
> [start date] Next_Appointment
> 1/31/2010 2/28/2010
>
>
> --
> Build a little, test a little.
>
>
> "LoriP" wrote:
>
> > I need to calculate many fields based on one start date and I need the
> > calculations to count by month.
> > For example first visit is 4/25/2010
> > The first calculated field must be 5/25/2010 +/- 7 days
> > This is the first time I've had to do a calculated field where the next
> > visit must be the exact day of the next month and not just the generic "30
> > days" Is there an easy way to do this?
> > Thank you
> > Lori

 
Reply With Quote
 
LoriP
Guest
Posts: n/a
 
      12th May 2010
Thank you for the quick answer. I was just not sure what to search for and
this got me aimed in the right direction.

"Chris" wrote:

> Hi,
>
> Go to online help and look for DATESERIAL function. I think that should
> help you out.
>
> "LoriP" wrote:
>
> > I need to calculate many fields based on one start date and I need the
> > calculations to count by month.
> > For example first visit is 4/25/2010
> > The first calculated field must be 5/25/2010 +/- 7 days
> > This is the first time I've had to do a calculated field where the next
> > visit must be the exact day of the next month and not just the generic "30
> > days" Is there an easy way to do this?
> > Thank you
> > Lori

 
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
Pivot table, IF function, calculated item versus calculated field NomadPurple Microsoft Excel Misc 1 9th Mar 2010 03:17 PM
Using the result of a calculated field in another calculated field's expression Paul Microsoft Access 1 12th Jan 2007 09:52 AM
Using the result of a calculated field in another calculated field's expression Paul Microsoft Access Queries 3 11th Jan 2007 04:53 PM
pivot table formulas for calculated field or calculated item =?Utf-8?B?Vmlja3k=?= Microsoft Excel Misc 3 6th Jun 2006 05:06 AM
Criteria on field calculated form another calculated field Max Moor Microsoft Access Queries 1 22nd Dec 2004 08:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 PM.