Question

Locked

transforming numeric data to "date" type

By watergrl ·
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.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

A few ways

by Tony Hopkinson In reply to transforming numeric data ...

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.

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums