How do i convert a varchar field into the datetime data type
-
hi, How do i convert a varchar field into the datetime data type? the reason i need this lies in the requirement that in the earlier data base the column that is holding the date value is having the data type as varchar. and in the new design the column data type is datetime. How i transfer old Data to new column without loss .from the older design to the newer and got stuck with this datetime convertion issue. do let me know the best possible solution.iam using sql server 2000 following are the sample date Format that is there in the older table for the date. dd/mm/yyyy. Regards Rameez
-
hi, How do i convert a varchar field into the datetime data type? the reason i need this lies in the requirement that in the earlier data base the column that is holding the date value is having the data type as varchar. and in the new design the column data type is datetime. How i transfer old Data to new column without loss .from the older design to the newer and got stuck with this datetime convertion issue. do let me know the best possible solution.iam using sql server 2000 following are the sample date Format that is there in the older table for the date. dd/mm/yyyy. Regards Rameez
Try:
Convert(DATETIME, 'your datestring in dd/mm/yyyy format here', 103)
--------------------------- Blogging about SQL, Technology and many other things