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

record selecton only evaluating first block

Status
Not open for further replies.

emcevoy

Programmer
Feb 4, 2001
144
0
0
CA
Hi,

I have a report that has the following record selection formula.

({tblEmpEvt.EmpEvt_RegDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_RegDt} < currentdate)

or

({tblEmpEvt.EmpEvt_FirstLaunchDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_FirstLaunchDt} < currentdate)

or

({tblEmpEvt.EmpEvt_CnclDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_CnclDt} < currentdate)

or

({tblEmpEvt.EmpEvt_CmpltDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_CmpltDt} < currentdate)

For some reason, this is only evaluating the first block of code, regardless of what order I put it in.

if anyone can help me out that would be great.

thanks
Eileen
 
How have you determined that only the first block of code is being evaluated? Have you checked what's in the Database->Show SQL Query? It would be good to include what's in there in your post.

Note that posting technical information is advised when requesting it, at least the basics, such as:

Crystal version
Database/connectivity used

For better results also include:
Example data
Expected output



One thing that might get you is if there's a null, so try the following on the first block to make sure that isn't a concern:

(
not(isnull({tblEmpEvt.EmpEvt_RegDt})
and
({tblEmpEvt.EmpEvt_RegDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_RegDt} < currentdate)
)
or
(
{tblEmpEvt.EmpEvt_FirstLaunchDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_FirstLaunchDt} < currentdate
)

or

(
{tblEmpEvt.EmpEvt_CnclDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_CnclDt} < currentdate
)

or

(
{tblEmpEvt.EmpEvt_CmpltDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_CmpltDt} < currentdate
)


If this doesn't help, try posting technical information.
-k
 
I'm not sure about your logic for each clause:

(
{tblEmpEvt.EmpEvt_RegDt} >= currentdate -1 and {tblEmpEvt.EmpEvt_RegDt} < currentdate
)

It seems to me that a date >= currentdate-1 and
< currentdate is the same as date = currentdate-1, although I don't see why this would cause the formula to fail. So you might have a problem with nulls as SV suggests, although you probably need to add not isnull() for each of the date fields.

-LB
 
hi,

Thanks for the info. will give that a try. as for the logic, what I need to capture is the stike of midnight. the way the database and the data is, this does the trick, anything else seems to miss it.

thanks

Eileen McEvoy
Authorized Crystal Engineer
Crystal Reports Consultant and Trainer
emcevoy@crystalconsulting.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top