Quantcast
Channel: convert string to date
Browsing all 10 articles
Browse latest View live

convert string to date

If you have only three underscore in your xml filename, you can try this as well:SELECT replace(parsename(replace(replace([fileName],'.','|'),'_','.'),1),'|xml','') FROM test

View Article



convert string to date

The reverse of .xml is lmx.. I just want to remove it from the final string segment with replace function.

View Article

convert string to date

Hi Jingyang what does lmx stands for in your query ThanksRaj

View Article

convert string to date

SELECT *,Reverse(Replace(Stuff(REVERSE(FILENAME),CHARINDEX('_',REVERSE(FILENAME)),Len(FILENAME),'') ,'lmx.','')) dt FROM test

View Article

convert string to date

DECLARE @tbl TABLE ( ID INT IDENTITY(1,1) PRIMARY KEY , [fileName] VARCHAR(100) ); INSERT INTO @tbl([fileName]) VALUES ('abcd_efgh_stry_2018-11-02.xml') , ('ghjk_tfgh_2018-11-02.xml'); select...

View Article


convert string to date

HI create table #a ( ID INT IDENTITY(1,1) PRIMARY KEY , [fileName] VARCHAR(100) ) INSERT INTO #a([fileName]) VALUES('abcd_efgh_stry_2018-11-02.xml'), ('ghjk_tfgh_2018-11-02.xml'); --select * from #a;...

View Article

convert string to date

create table #temp (col1 varchar(200)) insert #temp values ('abcd_efgh_stry_2018-11-02.xml'),('ghjk_tfgh_2018-11-02.xml')select...

View Article

convert string to date

Hi Rajm,If the format of final string  'xxxx-xx-xx.xml' is fixed, then you can use following code: IF OBJECT_ID('test') IS NOT NULL drop table test create table test( col varchar(100)) go insert into...

View Article


convert string to date

Hi Rajm0019,Here we go:DECLARE @tbl TABLE ( ID INT IDENTITY(1,1) PRIMARY KEY , [fileName] VARCHAR(100) ); INSERT INTO @tbl([fileName]) VALUES ('abcd_efgh_stry_2018-11-02.xml') ,...

View Article


convert string to date

Hi I have a filenames as    abcd_efgh_stry_2018-11-02.xml   ghjk_tfgh_2018-11-02.xml , I need an help on how to extract date from this strings.Please adviceThanks

View Article
Browsing all 10 articles
Browse latest View live




Latest Images