May 13, 2006 at 11:18 pm
I have a function that is based aounr the input of parameters. The last remaing issue is that I am required to enter the data into the parameter field as mm/dd/yyyy. I want to be able to enter the data as dd/mm/yyyy. I have tried to use
WHERE (CONVERT(datetime,src_terrier.datadate,103) = @dt_src_date) AND..........
But this just throws an error "Msg 8114, Level 16, State 1, Procedure spWTRalldatareportsummary, Line 0
Error converting data type nvarchar to datetime."
The execution line I am using is
USE [DashboardSQL-2K5]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[spWTRalldatareportsummary]
@dt_src_date = N'28/04/2006',
@chr_div = NULL,
@vch_portfolio_no = NULL,
@vch_prop_cat = NULL
SELECT 'Return Value' = @return_value
GO
Anybody got any ideas as to what I have done wrong? I have also tried it without the N just before the date and get a varchar version of the same error.
Thanks in advance
May 14, 2006 at 7:39 am
This should do it...
USE [DashboardSQL-2K5]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[spWTRalldatareportsummary]
@dt_src_date = CONVERT(DATETIME,N'28/04/2006',103),
@chr_div = NULL,
@vch_portfolio_no = NULL,
@vch_prop_cat = NULL
SELECT 'Return Value' = @return_value
GO
--Jeff Moden
Change is inevitable... Change for the better is not.
May 14, 2006 at 8:36 am
Thank you Jeff, I will give that a run now.
Watch this space!
Kindest Regards
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply