|
-
Jun 17th, 2005, 03:41 AM
#1
Thread Starter
Hyperactive Member
Problem with report (Closed)
Hello everybody
I`ve created a report wich gets its recordset from a rather intricate SQL statement, which I will not mention. The thing is that there exist two fields in every record, of which only one has a value and the other is null, or vice versa. In the report I`ve created an unbounded string field which should take on the value of the field which is not NULL. For this purpose some code has been written :
Code:
If Not (IsNull({Epis_Mhxanhma.Kwd_Etairias})) And IsNull({Epis_Mhxanhma.Kwd_Texnikou}) Then
{Etairia.Epwnymia}
Else
{Texnikos.Onomatepwnymo}
This code does not work even for a single recordset (If part asserted). But if I use the following code :
Code:
If Not (IsNull({Epis_Mhxanhma.Kwd_Etairias})) And IsNull({Epis_Mhxanhma.Kwd_Texnikou}) Then
{Etairia.Epwnymia}
Then I get all the records satisfying the IF statement but none of the others. Why is this so? Can I somehow restate what I`m trying to do?
thx, in advance
George Papadopoulos
Last edited by divined; Jun 27th, 2005 at 02:49 AM.
SteadFast!
-
Jun 18th, 2005, 11:09 AM
#2
Re: Problem with report
This code does not work even for a single recordset (If part asserted).
Do you mean an error is generated? If yes, what is the error.
The If..Then..Else is correct. Are the data types of Etairia.Epwnymia and Texnikos.Onomatepwnymo the same?
-
Jun 21st, 2005, 01:09 AM
#3
Thread Starter
Hyperactive Member
Re: Problem with report
Yes, Etairia.Epwnymia and Texnikos.Onomatepwnymo are both VARCHAR(30). As I stated before, I want only the field which is not null to be displayed. Table Epis_Mhxanhma has two fields, Epis_Mhxanhma.Kwd_Texnikos And Epis_Mhxanhma.Kwd_Etairias. Logically I want this to occur :
Code:
If Epis_Mhxanhma.Kwd_Texnikou Not Null Then
DisplayTexnikos.OnomatepwnymoInUnboundStringField
Else
DisplayEtairia.EpwnymiaInUnboundStringField
End If
for every record in the recordset. Am I doing something wrong?
-
Jun 21st, 2005, 01:55 AM
#4
Thread Starter
Hyperactive Member
Re: Problem with report
The code I used above seems logically sound, nonetheless it does not work as expected. This is how I got about it. Not a very elegant solution, but at least I can move forward. I created two Unboundstring fields and placed them one atop another. These UnboundString fields are being automatically bounded to the two database fields required. Now, only the field with a non null value will display some text while the other will display nothing. Therefore I need no formula code at all.
If anybody can point to the error in the initial code, please oblige!
George Papadopoulos
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
|