Ycsoftware.net
Menu
  • Databases
    • MySQL
    • MS SQL Server
    • Foxpro
  • Programming
    • .NET
    • C#
    • Drupal
    • Java
    • PHP
    • Javascript
  • System Administration
    • Hardware
    • Linux
    • MAC
    • Virtual Servers
    • VMWARE
    • Servers
    • VirtualBox
  • Web Design
    • CSS
    • Flash
    • HTML
    • SEO
  • Other
  • Contact Us
    • About Us

Add and Subtract Hours to T-SQL Datetime

  • December 10, 2010

Add to 1 hour to the Current Date

 DATEADD(hh,1,getdate())

Subtract 1 hour to the Current Date

 DATEADD(hh,-1,getdate())

Add 1 hour to the Current Time and returns just the time part

select Convert(varchar,( DATEADD(hh,-1,getdate())),8)

Reference
http://msdn.microsoft.com/en-us/library/ms186819.aspx

Let's share thisShare on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
  • Posted in: MS SQL Server, Programming
Next Post »
« Previous Post

Search

Follow Us

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube
Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube

Categories

.NET C# CSS Databases Drupal Flash Foxpro Hardware HTML Java Javascript Linux MAC Miscellaneous MS SQL Server MySQL Other PHP Programming SEO Servers System Administration Virtual Servers VMWARE Web Design

Recent Posts

  • Unable to connect to an older MySQL version with MySQL Workbench 8
  • Mysql Load_File Returns Null
  • Certbot – Attempting to renew cert produced an unexpected error- Ubuntu 20.04
  • Nagios – Stuck at Update in Progress
  • Enable SNMP php 7 Ubuntu

YCSoftware Recent Comments

thank you very much for posting this post, very helpful....
THANKS! FIXED the problem I was having!!! :) openSUSE LEAP 15.0 m...
perfect, thanks much...
thanks a lot...
Love it bro that worked for me thank you...
Same error, but on Mac, any ideas?...
Thanks very much !!!...
Just testing...
Awesome, problem solved. Thanks man....
REboot the MAC and Try to redownload the JDK. It might be that the JDK...

Sponsors

YCSoftware
  • © 2021 Ycsoftware.net
Top