For example, copying a file or saving an email message to a content folder does not put it on your local computer, but rather uploads and saves it on the content server. However, some tasks typically performed on files or folders on your local computer may have a different effect when performed on files and folders managed by a content server. You can copy files, drag and drop them into folders, right-click objects to open context menus, and so on. You work with content managed on a content server (the "files") in much the same way you do with other folders and files on your computer. The "files" in the content folders are not actual files on your local computer, but rather they are symbolic links or pointers to content items in the content server repository, each with a full revision history. You can perform content management tasks, such as checking out or copying a file, directly from this list. When you open a content folder, you see all files on the server in that folder for which you have access privileges. Also, you must enable the folder tree in your email application, as it is not displayed by default. For example, in Windows Explorer on Windows 7, choose Organize, then Layout, and then Navigation Pane. If you do not see the navigation pane in these applications, you must turn it on. The WebCenter Content Servers folder tree appears in the navigation pane of Windows Explorer and Microsoft Outlook. WHERE ISDATE(myDateColumn) = 0 AND MyDateColumn like '//'Īlso, you are putting the values back in the same column so you are overwriting the original data - and you have another implicit conversion back to a string I would strongly recommend that you add another column to the table with a datetime data type and put the correctly-typed value there.Figure 3-1 Example of Folder Tree with One Oracle WebCenter Content Server Connection (Fully Expanded)ĭescription of "Figure 3-1 Example of Folder Tree with One Oracle WebCenter Content Server Connection (Fully Expanded)" THEN CONVERT(DATETIME, myDateColumn, 103) SET myDateColumn = (CASE WHEN ISDATE(myDateColumn) = 0 AND MyDateColumn like '//' You may need to use a case as well: UPDATE myTable Note: the where clause will probably work here for the update. SET myDateColumn = CONVERT(DATETIME, myDateColumn, 3) WHERE ISDATE(myDateColumn) = 0 AND MyDateColumn like '//' SET myDateColumn = CONVERT(DATETIME, myDateColumn, 103) Otherwise, you could multiple updates: UPDATE myTable In SQL Server 2012, you could use try_convert(). Results are: OriginalDate FixedDate ConvertedDate WHEN DateString LIKE '_' THEN RIGHT(DateString, 4) + '-' + CONVERT(VARCHAR(2), DATEPART(MM, DateString)) + '-' + LEFT(DateString, 2)ĬONVERT(DATE, FixedString) AS ConvertedDate WHEN DateString LIKE '_/_/_' THEN '20' + RIGHT(DateString, 2) + '-' + SUBSTRING(DateString, 4, 2) + '-' + LEFT(DateString, 2) WHEN DateString LIKE '_/_/_' THEN RIGHT(DateString, 4) + '-' + SUBSTRING(DateString, 4, 2) + '-' + LEFT(DateString, 2) WHEN DateString LIKE '_-_-_' THEN DateString SELECT * FROM CONVERT(DATE, DateString) FROM DateDeconstruct AS ( I didn't write it as an update statement, but the query should be easy to adapt, and you should consider adding the converted date as a new proper datetime column if possible in my opinion.Įdit: here's the corresponding update statement: update d =įrom is totally horrid, but it works with your example: DECLARE TABLE ( It might not be that efficient, but I presume this is a one-off operation. When charindex('/',d) = 0 and isnumeric(d) = 0 then convert(date, d, 106) When len(d) = 10 then convert(date, d, 103) When isnumeric(left(d,4)) = 1 then cast(d as date) Something like this: declare table (d varchar(20)) My guess is that you just have to try to differentiate between the different classes and handle each case in the appropriate way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |