Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date parameters not passing to SQL Command Object Post Reply Post New Topic
Author Message
TallPaul
Newbie
Newbie


Joined: 10 Jun 2010
Location: United States
Online Status: Offline
Posts: 4
Quote TallPaul Replybullet Topic: Date parameters not passing to SQL Command Object
     Posted: 28 Aug 2012 at 4:57pm
I'm tring to write a simple SQL Command Object so I can push the LIKE command to the server instead of having it all sorted locally, and the parameters won't pass through to the SQL Command Object.  The client that this is for is using XI but I don't think they have any service packs installed.  Scary huh!

So far I've tried a few things but I'd think that just using a DateTime parameter in the Command Object would pick it up and use that fine.  It has no problems when passed from the application that is sending the DateTime value, but when I try to push it down to a Command Object I get it defaulting to today's date with no minutes.

This is the code: ... CompletedDTTM Between {?FromDate} and {?ToDate}

This is what I get in the SQL Profiler I see as it gets processed:
CompletedDTTM Between {ts '2012-08-28 00:00:00'} and {ts '2012-08-28
00:00:00'} no mater what dates I send.

The parameter is constructed correctly in the Command Object, but it just doesn't seem to come through.  I'm thinking it's a Crystal Bug and am hoping it's due to a patch not being applied.  They are going to update it soon, but in case that doesn't do anything ... Any ideas?

Thanks in advance...

- Paul

IP IP Logged
TallPaul
Newbie
Newbie


Joined: 10 Jun 2010
Location: United States
Online Status: Offline
Posts: 4
Quote TallPaul Replybullet Posted: 28 Aug 2012 at 5:00pm
Oh.. also ... it does run fine if I JUST run it in Crystal and not run it from the application.  The DateTime parameters do work fine if I use them in the main report and don't push them down into a Command Object, so why are they breaking when they try to push through to the second level???  
IP IP Logged
TallPaul
Newbie
Newbie


Joined: 10 Jun 2010
Location: United States
Online Status: Offline
Posts: 4
Quote TallPaul Replybullet Posted: 20 May 2013 at 7:57am
Still occurring.  Any ideas out there?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 May 2013 at 4:47am
OK, here is my standard answer with the Command object...though I don't know why it isn't working in your case.

I believe, and I never heard one way or the other so this is totally my opinion, that the Command object is to populate dynamic parameters, and was never intended to fetch data for a report. I know, many use as such, and in some cases (like not having the ability to create stored procs or the such) it is a valid use. I just don't think that the programmers intended it for this use, and so, as you say, it is buggy.

Usually what happens is that the user is double prompted for the parameters, once for the main report and once for the Command, but that obviously would not happen if the parameters are being filled in by an application.

Sorry, I am really of no help
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