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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<>values for date ranges

Status
Not open for further replies.

smut

Technical User
Nov 15, 2001
10
GB
Hi all,

History: I work for a telephone support company, and every enquiry we receive it has to be logged. These calls are left open if not resolved, if they are resolved they are closed.

I am creating a report in which shows these calls are open and closed at the beginning, end and during the time selected. I have two fields: one holds the dates inwhich calls are open (Calls.dateOpened) and the other shows the dates inwhich the calls where closed (Calls.dateClosed).

I also have two parameters one in which is {?start date} and the other {?end date}, these dates being the dates in which the user wants to show.

I can get a count of calls inwhich are logged and closed inbetween the {?start date} and {?end date}. What i can't do is get a count of all the calls inwhich are still left open before the {?start date} parameter selected, and also a count of calls still left open at the end of the date period.

I also have field {Qcallsstatus.status} inwhich shows the status of calls; either: "open" or "closed"

I am using a cross-tab and want to show the results in a chart.

I have tried using a formula field for calls Open before the date selected:
{QCallsStatus.Status} = &quot;Open&quot; and {Calls.DateOpened} >= {?start date} and {Calls.DateOpened} <= {?end date}

For calls inwhich are still open after the {?end date} selected ihave tried this in a formula field:
{QCallsStatus.Status} = &quot;Open&quot; and {Calls.Dateopened} <= {?end date} and {Calls.DateOpened} >= {?end date}.

Both of the formulas don't return the value im want. If anyone can help please do. Cos im very stuck.

Thankyou SMUT
 
&quot;I have tried using a formula field for calls Open before the date selected:
{QCallsStatus.Status} = &quot;Open&quot; and {Calls.DateOpened} >= {?start date} and {Calls.DateOpened} <= {?end date}&quot;

I don't understand here....you are looking for calls that are &quot;Open&quot; in a certain date range here....not what you describe.

For the second comparision...Try this instead, note the brackets around {?Start} and {?End} I think you meant {?Start date}..not {?end date}

{QCallsStatus.Status} = &quot;Open&quot; and ( {Calls.Dateopened} <= {?Start date} OR {Calls.DateOpened} >= {?end date})

I assume there is more to this formula than just the comparison and that this ***ISN'T*** in the Record Select Formula

in a general counting formula, you really don't need both comparisons

eg: Formula - @CountCalls

//initialize these variables to zero in another formula
numbervar OpenInRange ;
numbervar OpenOutRange ;

If {QCallsStatus.Status} = &quot;Open&quot; then
( if {Calls.DateOpened} >= {?start date} and
{Calls.DateOpened} <= {?end date} then
OpenInRange := OpenInRange + 1
else
OpenOutRange := OpenOutRange + 1;
);

*********************************
Since you have determined the calls to be Status &quot;Open&quot; if they aren't &quot;IN&quot; they are &quot;OUT&quot; :)

Other things to check for:

1. Do {?end date} and {?Start date}have the same data type as {Calls.DateOpened} ? a common problem is trying to compare a date/time field to a date field
2. Is your {QCallsStatus.Status} options &quot;Open&quot; or &quot;OPEN&quot;?
that is , is it case sensitive??
3. Is there a possiblity any fields can be null...if so you will have to check for these and take appropriate action

hope this helps
jim
 
O.k. i have tried this now, and it looks as though it works.
Problem is i think it might be showing all the calls open up until the present date.

What i want it to show is all the calls that are open up to the start date selected, and not closed before the start date.

So something like a &quot;Not > {?start date}&quot;, (Doesn't work). Sorry hope you understand.

P.S. You were right, i only meant to show QCallsStatus.Status} = &quot;Open&quot; and {Calls.DateOpened} <= {?start date}. My mistake sorry.

Thanks for your help so far

Chris
 
&quot;So something like a &quot;Not > {?start date}&quot;, (Doesn't work). Sorry hope you understand&quot;

That is correct this will not work in this syntax. If you wanted to do this the you could use

not({table.testdate} > {?start date})

but this would be very slow since it won't be pushed to the server in a Record Selection Formula...don't think so anyway

{table.testdate} <= {?start date}

does the same thing and certainly would be evaluated on the server...why can't you use that??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top