Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection formula

Status
Not open for further replies.

cdulong

Technical User
Joined
Nov 18, 2008
Messages
80
Location
CA
I need a selection formaula that work with the following information.

Each record has two fields which are defined as dates:

{table.Date of Transfer In} and {table.Date of Tranfer Out}

What I am looking for is a formula that will select the records that have dates between two dates. Some times there is only a date in one field and not in the other and some times there is a date in both. Either way I need to select the records that have at least one of the fields within the criteria.

Any help would be great.

Thanks,
 
Can either field be populated but with a null in the other field? Or is it really the case that nulls only occur in the transfer out field?

-LB
 
There are occations that one field is populated and the other has a null value. Then there is also times that both fields have values in them.
 
You might want to convert each date in a formula first so that they default to some very early or very late date (depending upon how you want to exclude them):

//{@trin}:
if isnull({table.dateoftransferin}) then
date(1970,1,1) else
{table.dateoftransferin}

//{@trout}:
if isnull({table.dateoftransferout}) then
date(2099,1,1) else
{table.dateoftransferout}

Then use a select formula like this:

(
{@trin} = {?daterange} or
{@trout} = {?daterange}
)

-LB
 
worked like a charm

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top