The sqldatetime tag has no wiki summary.
22
votes
4answers
27k views
.NET DateTime to SqlDateTime Conversion
While converting .NET DateTime (when is default(DateTime)) to SqlDateTime should I always check if the .NET date is between SqlDateTime.MinValue and SqlDateTime.MaxValue [or] Is there a good way to do ...
8
votes
1answer
78 views
MySQL query by date with big inverval
I have big table with 22 millions records.
I want to execute next query:
select auto_alerts from alerts_stat where endDate > "2012-12-01"
To improve performance I added BTREE index for ...
4
votes
1answer
451 views
How to extract a Date from an SQLDateTime object in Mathematica
I am trying to do a plot of a time series with DateListPlot. I want to feed it a time series I obtain from an SQL database. When I retrieve the time series the list is composed of SQLDateTime ...
3
votes
3answers
328 views
How does SqlDateTime do its precision reduction
Consider the following program:
DateTime dateTime = new DateTime(634546165144647370);
SqlDateTime sqlDateTime = new SqlDateTime(dateTime);
Console.WriteLine("dateTime.TimeOfDay = " + ...
3
votes
2answers
154 views
Mathematica - Select Range of SQLDateTimes
table = {{ID1, SQLDateTime[{1978, 1, 10, 0, 0, 0.`}]},
{ID2, SQLDateTime[{1999, 1, 10, 0, 0, 0.`}]},
{ID3, SQLDateTime[{2010, 9, 10, 0, 0, 0.`}]},
{ID4, SQLDateTime[{2011, 1, 10, 0, 0, 0.`}]}}
...
3
votes
4answers
79 views
Check if value is date and convert it
I am using SQL Server 2012
I receive data in a certain format.
Dates are numeric(8,0)
For example 20120101 = YYYYMMDD
There exists rows with values like (0,1,2,3,6) in that date field, thus not a ...
3
votes
4answers
67 views
Oracle Insert Multiple Value Shows Error Message
INSERT ALL
into instructor values (
835, 'SPARKS', 4000 , 200, 978, '16-12-1984')
into instructor values (
978, 'STEEL', 5000 , 250, 222, '16-01-1980')
and it was:
INSERT ALL
into instructor ...
3
votes
5answers
1k views
SQL Server - Round TIME values to the next minute
Good morning to all,
I've found many posts about rounding "down" time values (e.g. http://stackoverflow.com/a/6667041/468823), but I have another problem: I wanna round to the higher minute and not to ...
3
votes
2answers
957 views
Entity Framework and SqlDateTime overflow best practices
System.DateTime can take a wider range of values than SQL Server's DateTime. Hence there is class System.Data.SqlTypes.SqlDateTime which mimics the later.
Consequently I would have expected Entity ...
2
votes
1answer
1k views
Why can i insert MaxDate but not MinDate
when inserting into my table with a nullable datetime column, inserting DateTime.MinDate raises the error:
"The conversion of a char data type to
a datetime data type resulted in an
...
2
votes
1answer
624 views
SQLBulkCopy can't convert Time to DateTime
I am writing a small utility to copy a database from a proprietary ODBC database into a SQL Server database. Everything is working great, except when I use SQLBulkCopy to copy over the data. It ...
1
vote
4answers
1k views
SqlDateTime overflow, but I want a NULL or MinValue
On this project, I am tracking when something is created, edited, and finally processed. I have three DateTime fields setup for this. The code below is for when I create the record.
...
1
vote
1answer
220 views
Pass DateTime2 parameter value using ISqlQuery
I am using the ISqlQuery interface of Nhibernate to fire a SQL query on database. Following is the scenario. My Domain Model has a property:
public virtual Datetime StartTime { get; set; }
The ...
1
vote
3answers
1k views
SqlDateTime overflow on INSERT when date is correct using a Linq to SQL DataContext
I get an SqlDateTime overflow error (Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.) when doing an INSERT using an Linq DataContext connected to SQL Server database when I do the ...
1
vote
2answers
97 views
Convert SQLDateTime DayTicks back to DateTime value
I have a date value stored as an integer in a database that was created using the SQLDateTime DayTicks function. How can I reverse engineer that integer value back into a DateTime value?