Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zeros in text file date fields

Status
Not open for further replies.

Katy44

Technical User
Dec 12, 2003
723
GB
I have a text file which I am bulk inserting into a SQL Server (2000) table using a format file. There is a date field in the file which is usually fine or blank, but ocassionally has a zero in it. I would like it to treat these as nulls. Is there an easy way of doing this? I know that I could insert this field into a string field and then update the date field with the conversion...but that seems a long way round. Does anyone have a better idea? Any help would be appreciated, thanks.
 
I have dealt with this in the way I said - importing it into a string field then trying to convert it and putting a null in if it won't. There's no urgency, but if anyone does have a better suggestion I'd like to hear it still.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top