Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Using formula fields in sql queries Post Reply Post New Topic
Author Message
gepach
Newbie
Newbie


Joined: 10 Aug 2009
Online Status: Offline
Posts: 2
Quote gepach Replybullet Topic: Using formula fields in sql queries
     Posted: 10 Aug 2009 at 2:49am
Hi!

How do I use formula fields in a SQL query field?

Let's say, I have a formula field named "month", and a SQL query I want to use this field:

SELECT SUM(VALUE) FROM VALUETABLE WHERE VALUE_ID IS BETWEEN 1 AND 10
AND to_char(VALUE_DATE, 'mm') = @month

CR formula check says something like "expression missing"...

How to solve this?


Thank you
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Aug 2009 at 8:19am
you can't use a formula field in sql.  You can use parameters.
 
 
IP IP Logged
gepach
Newbie
Newbie


Joined: 10 Aug 2009
Online Status: Offline
Posts: 2
Quote gepach Replybullet Posted: 12 Aug 2009 at 12:58am
Thank you for your reply. Meanwhile I have found another solution for my problem. I use a SQL-Query as data source.
IP IP Logged
dpm1028
Newbie
Newbie


Joined: 04 Feb 2010
Online Status: Offline
Posts: 12
Quote dpm1028 Replybullet Posted: 26 Jul 2010 at 1:36pm
Can you tell me how you incorporated the Formula Fields in the data source?
 
Thanks
IP IP Logged
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