Ritu

Ritu

  • 1.4k
  • 347
  • 42.7k

Remove space between date

Sep 23 2021 9:28 AM

I have a procedure I want to remove space between date which is retrieved from getdate() function

ALTER PROCEDURE [dbo].[Insert_Proc]
(
 @EndUserType varchar(500) = null,
 @OrderDate datetime,
 @ItemId varchar(500),
 @CoNum varchar(500) = null
 )
AS
BEGIN
    INSERT INTO [SLCos] (EndUserType, OrderDate, ItemId, CoNum, Id, CreatedOn) 
    values (@EndUserType, @OrderDate, @ItemId, @CoNum, getdate(), getdate())    
    SELECT 1;
END

The output is 2021-09-23 05:22:44.627

but I want like this 

20210923052244627

without space, special character 


Answers (1)