Solved

Bitwise logic in record selection formula

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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