Question Locked

transforming numeric data to "date" type

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Does anyone know if it is possible to convert a numeric field to a date field?

The data is stored in 4 individual fields(CC,YY,MM,DD).

I'm working with a user defined database table in Transact-SQL on MS SQL Sever 2000.

If so, how?

Thanks in advance.

2 replies

by tony hopkinson

Here's a quick one, this is based on CC being 20

Select Convert(DateTime,Convert(VarChar(8),((20 * 100 + YY) * 100 + MM) * 100 + DD)
From SomeTableOrOther

Slightly sneaky , but otherways would require a lot of typing.

This discussion is closed to new replies.