Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: sql function in command Post Reply Post New Topic
Author Message
niha
Newbie
Newbie
Avatar

Joined: 05 Jun 2015
Online Status: Offline
Posts: 28
Quote niha Replybullet Topic: sql function in command
    Posted: 02 Jul 2015 at 7:23pm
something like this

select a.name,b.rate,dbo.[getname(@empid)] as 'empname'
from abc a join bca b on a.id=b.id and join cab c on b.cid=c.cid i have written select query like this not the table name and filed name are real but for just example.

so this query i used in command in crystal report
it gives me error if m used this dbo.[getname(@empid)] as 'empname' if I'm remove it no error.
need help as soon as possible.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Jul 2015 at 8:31am
It appears that getname is a stored procedure or a view.  I know that sometimes Crystal Reports has issues 'seeing' SP's and views depending on security set on the database.  Also make sure that under File,Options, Database that Views and Stored Procedures are checked.
IP IP Logged
niha
Newbie
Newbie
Avatar

Joined: 05 Jun 2015
Online Status: Offline
Posts: 28
Quote niha Replybullet Posted: 07 Jul 2015 at 7:58pm
as in crystal reports command is only use to give the idea that the firld is which type
string ,number,etc.

it gives error like @empid paramter need to paas but i dont want to paas it
]then after i just change selct query in cimmmand of crystal report like this

select a.name,b.rate,'' as 'empname'
from abc a join bca b on a.id=b.id and join cab c on b.cid=c.cid

it gives no error but data not came?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jul 2015 at 4:17am
I have never tried to call a sql custom function in a command. Just a guess but the function is likely just a replicating a join from a code on your primary table to an employer table that stores the name. Using a join should do the same thing. You would need an outer join if any rows in your primary table have no matching record
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.031 seconds.