Jump to content

how to execute a function


injesus

Recommended Posts

Hello I have this function but to mark error errors of several forms as I can execute it correctly.the code is:CREATE FUNCTION convertingdata (@inicio int)RETURNS intASBEGIN declare @ano int, @fechastem varchar(14),@mes int, @dia int, @itemtemp int select @fechastem=convert(varchar(14),@inicio) select @dia = substring(@fechastem,7,2),@mes=substring(@fechastem,5,2),@ano=substring(@fechastem,1,4) select @fechastem=convert(varchar(2),@dia)+'/'+convert(varchar(2),@mes)+'/'+convert(varchar(4),@ano) select @itemtemp=convert(int,@fechastem) RETURN(@itemtemp)ENDthe objetive is convert form '20060502' to '02/05/2006'out of the function it works but as function notI hope that they could help me Thank you

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...