Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi,I`m writing a stored procedure for a crystal report I`m doing. I want to know if there would be any way you could pass a input datetime field in the stored procedure to a crystal report such that crystal report will pick it up as a date variable and not a datetime variable. ie when entering variables upon refreshing the report, you will only need to select a date not a date and time.I know this is kindof pedantic and strange but its something that management doesn`t seem to like and I don`t have a say in it. Ah, Such is life... thanks in advance!
RickD
Slow But Sure Yak Herding Master
3608 Posts
Posted - 2004-06-15 : 08:40:26
Let them just choose a date and put:-
set @Date = isnull(dateadd(dd,datediff(dd,0,@Date),0),dateadd(dd,datediff(dd,0,getdate()),0))
This gets rid of the need for the date part, but it will still display on the parameter from crystal... Other than this all you can do is pass the date through as a character field and then convert it at the beginning of your procedure...