[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

Using SQLServer DateTime as parameters in Crystal Reports

When the parameter is prompted
It wants date in the following format mm/dd/yyyy hh:mm:ss AM or PM

How do I correctly set this up
I can address it in the SQL Server table I create or on the Crystal report side


0
hlevine5
Asked:
hlevine5
  • 2
  • 2
1 Solution
 
chapmandewCommented:
It probably notices the DataTime param and wants an exact format for it.  You can try entering '01/01/2008' in the report...it will probaby work for you that way.  If not, then you can change the stored procedure to accept a varchar(10) as the date, and handle it in your proc that way.  You can cast the string '01/02/2008' as a date like this:  CAST('01/01/2008' as DATETIME).  Hope this helps.
Tim
0
 
hlevine5Author Commented:
Let me test
So Set the field in SQL server as text and then extract using the CAST?

0
 
chapmandewCommented:
Yes, make the SQL parameter a VARCHAR(10)  (text), and then handle the date in the stored procedure by casting it to a datetime.
0
 
hlevine5Author Commented:
Thankk you solution works fine
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now