Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rternier
Starting Member
44 Posts |
Posted - 2008-11-12 : 11:27:54
|
| I have 2 DateTime objects in C# (.net 2.0) The current date i'm working with is: Aug, 10 1:01am and Aug 10, 10:00am.Everything works great when giving these 2 values to SQL Server. however, if I do:myDateTime.Hours.Add(-3) to one of those datetimes and pass it in, SQL will not handle it correctly. This could be because different regions on the servers but I have no control over that.So, I want to switch my datetime object to Ticks, and have SQL Server read them in and transfer to a DateTime, but I'm not sure how to do that.Any help would rock.----Killer ASP.NET ninja coding monkeys do exist![url]http://weblogs.asp.net/rternier[/url] |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-11-12 : 12:02:02
|
| you need to show some code and examples regarding what you are trying to do. There's lots of places thing could be going wrong in passing your DateTime to SQL, but it's impossible to guess without more details. I suspect you are probably not using properly typed columns, parameters and/or variables somewhere... (i.e., instead of using the proper DateTime data type everywhere, I bet you are using Strings/VARCHARS)- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
|
|
|