Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

how to convert a datetime to varchar for comparing a field

$
0
0

I am importing an Excel file into the SQL server table.  One of the fields is called DOB and it displays for example as 04141963.

However, when the import is completed in the SQL Server table, the format is datetime.  I am having trouble to compare the datetime with a varchar field from another table.

I am trying to change the DOB from the Excel file for the entire column by:

Got to Data -> Text to Column Option.  Select Delimited option in the first screen and than follow next steps.  Don't change anything in next steps.  GO to next and last steps, change the COlumn Data to Text, and Finish.

This won't work.

Could you please help to show me how to change the Excel file for a field in datetime to a varchar data.

Thank you very much for your help.

Sally


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>