Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: SQL expression fields Post Reply Post New Topic
Author Message
bobsn
Newbie
Newbie


Joined: 19 Mar 2007
Online Status: Offline
Posts: 27
Quote bobsn Replybullet Topic: SQL expression fields
    Posted: 16 Aug 2007 at 8:11am
Hi all,
    I have been trying to explore the features available in CR XI R2.
Can you give me any instances where you had a chance to use SQL expression fields... The category does not appear all the time in the Field explorer... why?
 
Is there a certain syntax associated with it.. If you can give me example of atleast one expression, that would be great...
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 16 Aug 2007 at 4:59pm
SQL Expression fields are only available if you are using a client/server database and then only through certain types of connections to the database (native works, but I'm not sure about ODBC, ADO, OLEDB, etc.)
 
To set one up, you have to use SQL that is valid in your database.  I've used them as substitutions for formulas in certain circumstances when I want the processing to happen on the database instead of in Crystal.
 
For example, our database has a number of indicator fields that have YES, NO, or null values and null means NO.  I've created SQL Expressions on these fields that translate the null to NO when pulling data from the database so that I don't have to do the translation in multiple formulas in Crystal.
 
-Dell
IP IP Logged
bobsn
Newbie
Newbie


Joined: 19 Mar 2007
Online Status: Offline
Posts: 27
Quote bobsn Replybullet Posted: 20 Aug 2007 at 8:48am
Hi Hilfy,
    That makes sense to me. Can you provide an example, if possible.... So that I can get the syntax in my head..
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Aug 2007 at 9:41am
You can use any SQL expression that's valid for your database.  The example that I gave above looks like this:
 
nvl(Loan.Inactive_Ind, 'NO')
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.