Ritu Gupta

Ritu Gupta

  • 1.9k
  • 177
  • 4.2k

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)