• Marv2011 (5/6/2011)


    Yes, the field is a datetime field. 2009-07-15 17:30:00.000

    Try out this ..

    create table #temp_table

    ( a datetime)

    go

    insert into #temp_table (a) values (getdate())

    insert into #temp_table (a) values (getdate()+.10)

    insert into #temp_table (a) values (getdate()+.09)

    go

    select Case when datepart(hour, a)>12 then datepart(hour,a) -12

    else datepart(hour,a)

    End as 'Standard Hour'

    from #temp_table

    go

    drop table #temp_table

    Regards,

    Sachin