Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: DateTime parameter for StoredProcedure Post Reply Post New Topic
Author Message
Matt51
Newbie
Newbie


Joined: 02 Jul 2007
Online Status: Offline
Posts: 4
Quote Matt51 Replybullet Topic: DateTime parameter for StoredProcedure
    Posted: 03 Jul 2007 at 1:38am
When we specify DateTime parameter and set it to Stored Function,
it causes SQL error, says
Incorrect syntax near '{'
SQL State : 42000
Native Error : 170
 
When we set Date, not DateTime, it's OK.
But I need to set DateTime.
 
When we set DateTime to usual WHERE statement, it seems to work fine.
 
How can I solve the problem?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Jul 2007 at 10:59am
Can you explain in more detail how you are linking to the table and using the parameter? I created a SQL command and used a DateTime parameter with it. Everything works fine and I can't recreate the problem. Also, what is your database? I'm using SQL Server.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Matt51
Newbie
Newbie


Joined: 02 Jul 2007
Online Status: Offline
Posts: 4
Quote Matt51 Replybullet Posted: 03 Jul 2007 at 9:56pm

Thank you for your reply.

I use SQL Database.

I found the following result.

* We can't set DATETIME parameter(not DATE) to Stored Function directly
* But if we use Transact SQL as follows, we can solve the problem.
 
declare @start_time datetime
set @start_time={?start_time}
select * from get_JapaneseCalendar(@start_time)
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Jul 2007 at 11:05pm
Oh. I understand now. I didn't realize you were using a SQL function. If this isn't working (as you said), then I would think its a bug that they never tested. I could see how this would slip by the QA test cases since it is a pretty unique circumstance. I'm glad you got it working now.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.