Jump to content

Date Calculation and search


falstaff

This topic is 8668 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I want to calculate a date - for instance - date A + 180 = date B. Date B then appears as a serial number. I can use Date to Text to format it as date, but then I cannot find dates in the calculated field using a date range search. I want to be able to calculate the date as above, to search for a date range against the calculated field, and to be able to override the calculated date with a different date. Any thoughts.

Link to comment
Share on other sites

If I understand you correctly, you want to add 180 days to a date?

Create field Date A for original date.

Then create field Date B as date field which auto-enters calculation:

(Date (Month(DateA), (Day(DateA) + 180), Year(DateA)))

You will be able to override this unlike if the field were a calculation field. The main problem with this is that if original date field is changed, this field will not update unless you do a re-lookup. (Re-look up does not affect any records where auto-enter was overiden)

This way the result of the calculation is a date and a range of dates may still be searched. You may custom format this date as serial number style in layout mode (18 Nov 2000 becoming 18112000) and you may still search using date range.

I hope that I have understood your question and been of some help.

------------------

Mikhail Petrovich Vimov

Link to comment
Share on other sites

A date range search should work on a calculated field. Are you sure you set the calculation result to "date"?

If your fields are "Date", "Date Entry" for manual entry, and "cDate" for calculated date:

cDate =

Case (

not IsEmpty (Entry Date), Entry Date,

not IsEmpty (Date), Date,

TextToDate ("")

)

-bd

[This message has been edited by LiveOak (edited August 21, 2000).]

Link to comment
Share on other sites

quote:

Originally posted by LiveOak:

A date range search should work on a calculated field. Are you sure you set the calculation result to "date"?

If your fields are "Date", "Date Entry" for manual entry, and "cDate" for calculated date:

cDate =

Case (

not IsEmpty (Entry Date), Entry Date,

not IsEmpty (Date), Date,

TextToDate ("")

)

This could also be used to add to the Date field:

cDate =

Case (

not IsEmpty (Entry Date), Entry Date,

not IsEmpty (Date), Date + 180,

TextToDate ("")

)

-bd

[This message has been edited by LiveOak (edited August 21, 2000).]

Link to comment
Share on other sites

This topic is 8668 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.