Solved

Bitwise logic in record selection formula

Posted on 2004-08-31
2
855 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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