injesus Posted May 2, 2006 Share Posted May 2, 2006 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 More sharing options...
injesus Posted May 12, 2006 Author Share Posted May 12, 2006 Answering to my own questiononly it usesselect fecha=dbo.convertingdata ('20060503')it is quite and this way the majority of the functions can be used Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now