Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Parameter in Stored Proc, want prompt for Date only in CR11

Status
Not open for further replies.

akabatman2

Programmer
Feb 25, 2003
102
US
Hello all,

I am trying to use the new Crystal Reports XI. (Version 11)
I have a stored procedure that uses the following SQL Stored procedure parameters:

@EstPowerEndDateStart datetime,
@EstPowerEndDateEnd datetime,
@RenewalDate datetime,

SQL Server only allows datetime and smalldatetime data types, when I try to run the Crystal Report that is based on this stored procedure, the new prompt dialog box forces the user to enter the datetime exactly as '2004-01-01 12:00:00'.

I want the user to just be able to enter dates like '01/01/2004'.

Does anyone know how to remedy this? With using the new cascading prompt or parameter features of CR 11 or some other Crystal Reports hack?

Thanks in advance.
 
Nope. All you can do is tell your users to ignore it (if that's what you want), and deal with stripping off the time portion within the procedure.

-dave
 
Thank you for the response vidru.

This isn't what I am looking for though.
It is not stripping off the time that I am trying to accomplish, I would like to have the prompt be user friendly.

Most people here like to type dates into the parameter dialog boxes like this:

4/3/2004 or 4/3/04

Crystal XI is expecting that the date and time be entered in accordance with the datetime datatype which the T-SQL stored procedure is set to as in my parameter declaration above.

The datetime parameter (from within Crystal)expects:

2004-04-03 12:00:00

Does Crystal XI provide a way to allow for the date to be entered as 4/3/2004?

In SQL Server, even though the field's datatype is set to 'datetime', I can still enter a date of '4/3/2004' when I execute the stored proc from SQL Query Analyzer with the EXEC statement.

What I want to know is if Crystal can be made to be flexible with datetime data entry in the new parameter functionality of any other way that works.

Thank you.
 
Does Crystal XI provide a way to allow for the date to be entered as 4/3/2004?"

No, not unless you change the datatype of the parameter to a String (or a VARCHAR if the parameter is from the procedure). Just so you know, that date format isn't limited to SQL Server stored procs...

I don't know why they moved from mm/dd/yyyy format in XI, but I've heard many complaints about it.

If you're creating reports that will be called from within an application, the workaround would be to design your own parameter entry screens, and not use the CR default parameter window.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top