How to add apostrophe as a text in a char of date?
    9 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Smithy
 am 23 Aug. 2022
  
    
    
    
    
    Kommentiert: Star Strider
      
      
 am 23 Aug. 2022
            Hello everybody,
I would like to create a character vector.
I tried below code.
DATE = '2019-05-31';
A2 = ['TO_DATE(',DATE,', ''YYYY-MM-DD'') '];
the answer is 
A2 =
    'TO_DATE(2019-05-31, 'YYYY-MM-DD') '
But I hope to make the  answe as below. It has the apostrophe between date as '2019-05-31'.
'TO_DATE('2019-05-31', 'YYYY-MM-DD') '
Is there a way to do it?
0 Kommentare
Akzeptierte Antwort
  Star Strider
      
      
 am 23 Aug. 2022
        I am not certain what result you want.  
Try this — 
DATE = '2019-05-31';
A2 = ['TO_DATE(''',DATE,''', ''YYYY-MM-DD'') ']
Note the doubled single apostrophes.  
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Time Series Objects finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

