Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

date-time difference

plumbergplumberg Veteran, Megathread Squad

I have some datetime columns in a MSSQL db... start_time/ End_time.
Each containing values in format "2015-01-03 05:45:01"

I want to find the difference between the end time and start time. What is the best way to achieve the same? For eg:
End Time: "2015-01-03 05:45:01"
Start Time: "2015-01-03 01:35:01"
--> 4 hours 10 minutes (or likes)

There is a possibility that my start time and end time span multiple days.

I tried datediff, but, it does not give accurate results. Any help is appreciated.

Comments

  • plumbergplumberg Veteran, Megathread Squad

    Bump...

  • You did SELECT DATEDIFF(minute, '2015-01-03 05:45:01', '2015-01-03 01:35:01') ? What kind of accuracy do you want? What do you mean by inaccurate?

    Maybe the columns are in different timezones, which might make it look incorrect.

Sign In or Register to comment.