General information
Forum:
Microsoft SQL Server
I am having trouble with converting dates. I get the following message:
"Server: Msg 241, Level 16, State 1, Procedure sp_fy_gen, Line 31
Syntax error converting datetime from character string."
Part of Code below
"@tcp is the input parameter"
Declare @string varchar(12),
@bofy datetime
if month(tcp) > 9
set @string = '10/01/' + str(year(tcp))
set bofy = convert(datetime, @string, 101)
end if
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only