Questions tagged [datetime2]

A SQL Server type that defines a date that is combined with a time of day that is based on 24-hour clock. datetime2 can be considered as an extension of the existing datetime type that has a larger date range, a larger default fractional precision, and optional user-specified precision.

A SQL Server data type that define a date that is combined with a time of day that is based on a 24-hour clock. datetime2 can be considered as an extension of the existing datetime type that has a larger date range, a larger default fractional precision, and optional user-specified precision.

References and resources

155 questions
-1
votes
2 answers

How to remove trailing zeros from milliseconds value(datetime 2)in string format by one query

I used SQL Server. I converted value from datetime2 column with different scales to string and compare them to process null values if they are exist. So, I need to convert this data without tailing nulls by one query without any procedures For…
-1
votes
1 answer

Datetime2 vs. String performance in SQL Server

What are the advantages of having a column of type datetime2 in SQL Server instead of a string? Obviously strings are much more flexible. Are there performance advantages while querying? I'm designing a database where all entries are added via…
japem
  • 1,037
  • 5
  • 16
  • 30
-1
votes
2 answers

Convert from 'YYYYMMDD' format to to SQL Datetime2

I have an issue concerning conversion in SSIS. I'm trying to convert StartDATE from DT_WSTR to Datetime2 (for SQL Server) My date originaly looks like this 20140804 but I need to convert it to Datetime2 in such format 2014-08-04…
user3052850
  • 178
  • 3
  • 17
-2
votes
1 answer

Joining tables based on datetime2 predicate

How do I join tables A and B (see pic) on TripID and where TimeTriggered is between SegmentStart and SegmentEnd? I could try: FROM TableA A INNER JOIN TableB B ON A.TripID = B.TripID AND B.TimeTriggered BETWEEN A.SegmentStart AND…
-2
votes
1 answer

How to get the values in between a particular range timestamps

I have table in SQL Server 2008 called ,timestamplog which contains one column of name LogTime of typeINTEGER` The values are like this: 1350468610, 1350468000, 1350381600, 1350295810 I need the values in between 1350468609 and 1350468001.. Please…
user1716577
  • 29
  • 1
  • 7
1 2 3
10
11