Importing dates...

  • i have a tab delimeted file with dates....the dates are in format mm/dd/yyyy

    now, when i import it into SQL Server, I want to be able to use the dates in a mathematical way. For example, I want to be able to see how many x has occurred since a date.

    I assume I need to change it from varchar and also modify it to yyymmdd format. Am I right?

    What's the best way?

  • In most cases it's best to store date data in datetime columns.

    Transform the data to datetime data type (DTS can do this) and use date functions such as datediff to work with it in T-SQL. 

    Greg

    Greg

  • Thanks. Where's a good place to learn about working with dates, using datediff, etc.?

  • I would say BOL is the best place

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply