I have an ID column coming from different source systems. This ID is sometimes NULL and the downstream requirement is NOT to have any null's on the reports. Hence business has decided to use the Timestamp field(Created Date) to replace NULL's in the ID column.

So when ID is NULL, I wanted to convert my CreatedDate as ID(to INT) so it would be unique for any NULL record.

Example:If `ID = NULL` and `CreatedDate = 2015-12-09 23:12:44.947`
then `ID = 09122015231244(DDMMYYYYHHMMSS)`

Currently, my code is as below which is not yielding expected results:

```
Convert (nvarchar(50),(Convert(BIGINT,(DATEPART(day,CreatedOn)*1000000 
+ DATEPART(MONTH,CreatedOn)*10000 + DATEPART(Year,(CreatedOn)) )) *10000
+DATEPART(HOUR,CreatedON)*100 +DATEPART(minute,CreatedOn)
+ DATEPART(second,CreatedOn)))

```

Any help would be much appreciated.