Solved

Bitwise logic in record selection formula

Posted on 2004-08-31
2
834 Views
Last Modified: 2008-02-01

Public Const LngVal As Long = 2048

'In vb for bitwise operation you do this.
if table.fieldname and Lngval = 0 then
end if

I need to do the same in crystal reports in record selection formula. How to handle bitwise logic in record selection formula in crystal reports.

table.fieldname not in (table.fieldname and lngVal = 0)
or
table.fieldname not in (table.fieldname and lngVal > 0)

Note :

where table.fieldname value is 1114112
0
Comment
Question by:PradeepYadhav
2 Comments
 
LVL 10

Expert Comment

by:ebolek
ID: 11941377
all the statements must be boolean, in other words, the formula should give out boolean for record selection formula

you can write smt like this

table.fieldname not in (table.fieldname and lngVal = 0)
or
table.fieldname not in (table.fieldname and lngVal > 0)

and table.fieldname <> 111412

Regards
Emre


0
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 11941455
Crystal supports the following bit operators: Not, And, Or, Xor, Eqv and Imp

Usage of them is exactly as used in vb.  Note that order of precedence is the order listed above but just like vb you can use parenthesis to override the default order.

I'm not sure exactly what you're trying to accomplish though but I think the formula you want for record selection is actually this:

(not (table.fieldname and lngVal = 0)) and (not (table.fieldname and lngVal > 0))

HTH

frodoman
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now