1 Replies - 484 Views - Last Post: 20 November 2011 - 09:27 PM Rate Topic: -----

#1 The answer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-November 11

Convert Integer Data to DateTime

Posted 20 November 2011 - 08:51 PM

How will i convert this kind of data into datetime

Sample:
Convert 70000(data type is integer) to 07:00 AM(DATETIME data type)
Is This A Good Question/Topic? 0
  • +

Replies To: Convert Integer Data to DateTime

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8951
  • View blog
  • Posts: 33,550
  • Joined: 12-June 08

Re: Convert Integer Data to DateTime

Posted 20 November 2011 - 09:27 PM

What database is it for? With MSSQL you can use 'substring'.
http://msdn.microsof...y/ms187748.aspx

You might have to pad the number to the left with a zero first but it seems to be that

substring start = 1, length= 1 gets you the 7
substring start = 2, length = 2 gets you the first 00
substring start = 4, length = 2 gets you the second 00
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1