Solved

Bitwise logic in record selection formula

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

17 Experts available now in Live!

Get 1:1 Help Now