Re: Convert float time to date/time?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jacco Schalkwijk (jacco.please.reply_at_to.newsgroups.mvps.org.invalid)
Date: 10/14/04


Date: Thu, 14 Oct 2004 17:15:06 +0100

SELECT DATEADD(hh, CONVERT(int, [time])/100, (DATEADD(mi, CONVERT(int,
[time]) %100, [date]))

-- 
Jacco Schalkwijk
SQL Server MVP
"Renae" <hilary321@yahoo.com> wrote in message 
news:bb43f5e8.0410140803.750a6077@posting.google.com...
>I have two columns that I need to create a datetime column from in SQL
> Server 2000.
>
> The first is a float that represents military time.  The second is a
> date field.  They both are being imported from Oracle.
>
> So, date: 1/12/2003 time: 1223 should become: 1/12/2003 12:23 PM.
>
> Any ideas?
>
> Renae
> hilary321@yahoo.com 


Relevant Pages

  • Re: NULL Records
    ... I don't think that the fact that your column is named KEY is the cause of ... Jacco Schalkwijk ... >> SQL Server MVP ... >>>>> error saying KEY Column information is insufficient or incomplete. ...
    (microsoft.public.sqlserver.server)
  • Re: How can I control execution wait time within a stored procedure?
    ... "Ken Sturgeon" wrote in message ... Any pointers you might have to articles, ... > "Jacco Schalkwijk" ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: ORDER BY CASE failure on Computed Field
    ... "charles" wrote in message ... > "Jacco Schalkwijk" ... >> SQL Server MVP ... >>> WHEN 'NumPosts' THEN NumPosts ...
    (microsoft.public.sqlserver.programming)
  • Re: Duplicate Entries Help
    ... > Since there are up to 20 rows per DMCUSERID and per CHARTPERIODID I ... > "Jacco Schalkwijk" ... >> WHERE EXISTS(SELECT NULL FROM userchartentry u1 ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: Insert list of tables and columns into custom tables
    ... > "Jacco Schalkwijk" ... >> your database, it is simpler to use views instead of tables: ... >> CREATE VIEW SecTables ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.programming)