I have [quote]declare @t datetime = '2016-11-02 07:22:26.320'SELECT LEFT(CAST(REPLACE(CONVERT(VARCHAR, @t, 108), ':', '') AS INT), 6)[/quote]which gives me INT value of 72226, and I want it to include the Zero, to be 072226. I also want to add 1 before the results, to be 1072226, even if @t datetime = '2016-11-02 14:22:26.320', the results should be 1142226
↧