Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bitwise logic in record selection formula

Posted on 2004-08-31
2
Medium Priority
?
916 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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. …
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 …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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