Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to ue sp date parameter in CR Post Reply Post New Topic
Author Message
flintwood
Newbie
Newbie
Avatar

Joined: 31 Jul 2010
Online Status: Offline
Posts: 16
Quote flintwood Replybullet Topic: How to ue sp date parameter in CR
     Posted: 02 Sep 2010 at 3:08am
I have a stored procedure from sql server database that has a start date and end date parameters as nvarchar data types, but now if I run this in crystal reports will there be a problem with the date a format? The Rreason why I used nvarchar for the date is because that is only way it works in the stored procedure  because it is used in the
 
Declare @x nvarchar (1000)
 set @x = select A from b where Datefield is > Start date or < end date.
 
The @x is an nvarchar type, so everything has to match the data type. So anyways just wondering what would be the work around if crystal shows an issue with the date format. Any help will be appreciated. 
FW
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Sep 2010 at 7:18am
just because a variable in your stored proc is nvarchar doesn't mean that your parameters need to be. 
With that said, if you pass in a datetime field from crystal to sql server, it should be treated correctly
IP IP Logged
flintwood
Newbie
Newbie
Avatar

Joined: 31 Jul 2010
Online Status: Offline
Posts: 16
Quote flintwood Replybullet Posted: 03 Sep 2010 at 3:31am

the stored proc actually worked in crystal, but now i need to create another identical stored proc using another database and call it sp_b. So what would be the syntax to call stored sp_a from database A within stored sp_b from database B? the sp_a has input parameters @tablename, @start date and @enddate. This is not a sql forum but does anybody have an idea of how to do that? Your help is greatly appreciated

FW
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Sep 2010 at 3:18am
probably something like:
exec a.dbo.sp_a
 
databaseName.User.storedproc
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