|
-
Oct 25th, 2006, 08:11 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Help in creating a formula
I am on creating an Accounts Receivable report with Crystal Reports wherein I am using a Select Query coming from my Access database and vb.net 2005 as my front end application.Now, on the query there were fields PatientName and Company.Basically, a Patient would have a Company that would shoulder his/her charges, but on some occasions there was none so the charges would be named to themselves.Using this scenario, I made my report grouped by Company's name in ascending order and make a formula field named @Patient with the code goes like this:
VB Code:
'Crystal Report Code
if {AccountReceivable.Company}="" then {AccountReceivable.PatientName} else {AccountReceivable.Company}
My logic here is that when a Patient does not have a Company, then his/her name would be displayed on the report where this formula was situated.Seems that it is not behaving the way it should be.Am I missing somthing here guys?Hope you figure it out for me.Should you need further infos or an attachments perhaps, feel free to ask...Thanks.
-
Oct 25th, 2006, 09:58 PM
#2
Re: Help in creating a formula
The formula make by you is working properly then where you are getting the problem.Is it not working properly.
If your formula not working properly then pass a sql query that select those patient they have a company in this way there is no need of formula here.
Because you sorted the data directly with the query.
-
Oct 25th, 2006, 10:47 PM
#3
Thread Starter
Hyperactive Member
Re: Help in creating a formula
I finally find to make this work.I manage to check if the field is null first.Here's my revised code:
VB Code:
'CrystalReport Code
if isnull({@Company}) then {AccountReceivable.Name} else {AccountReceivable.Company}
where @Company is another formula with code that goes like this:
VB Code:
'CrystalReport Code
if {AccountReceivable.Company}<>"" then {AccountReceivable.Company} else {AccountReceivable.Name}
-
Oct 26th, 2006, 01:14 AM
#4
Re: Help in creating a formula
so did you get your solution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|