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.
| Author |
Topic |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2010-02-17 : 11:05:11
|
| i have stored procedure inside i wrote procedure for date formatUSE [smartsystem]GO/****** Object: StoredProcedure [dbo].[procstdgaugegrid] Script Date: 02/17/2010 21:19:02 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER procedure [dbo].[procstdgaugegrid](@fldguagekey int)asset nocount ondeclare@key intset @key = @fldguagekeyselect fldguagekey,fldslno,fldgoupper,fldgolower,fldnogolower,fldcerfno, ufn_getdateonly(flddoc),ufn_getdateonly(flddonc) from stdgaugedetail where fldguagekey = @key order by fldslnomy function is ufn_dgedateonlycreate FUNCTION [dbo].[ufn_GetDateOnly] ( @pInputDate DATETIME )RETURNS DATETIMEBEGIN RETURN CAST(CAST(YEAR(@pInputDate) AS VARCHAR(4)) + '/' + CAST(MONTH(@pInputDate) AS VARCHAR(2)) + '/' + CAST(DAY(@pInputDate) AS VARCHAR(2)) AS DATETIME)ENDbut if i excute the stored procedure i through error'ufn_getdateonly' is not a recognized built-in function name.pls guide meDesikankannan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-17 : 11:08:54
|
| you should access it along with schemaname asdbo.ufn_getdateonly(flddoc) etc.why do you need this function? as told in earlier thread this is something to be worried at front end and its really ugly to do this at sql query levelhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140010------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-18 : 01:15:08
|
| Isn't it very easy if you use data.tostring("dd/MM/yyyy") instead of all these code?MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-18 : 01:19:26
|
quote: Originally posted by madhivanan Isn't it very easy if you use data.tostring("dd/MM/yyyy") instead of all these code?MadhivananFailing to plan is Planning to fail
May be he loves SQL too much and wants to use for everything ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-18 : 01:25:32
|
quote: Originally posted by visakh16
quote: Originally posted by madhivanan Isn't it very easy if you use data.tostring("dd/MM/yyyy") instead of all these code?MadhivananFailing to plan is Planning to fail
May be he loves SQL too much and wants to use for everything ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
May be he loves writing Complicated code MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|