Groups | Blog | Home
all groups > c# > october 2007 >

c# : Store Date/Time in SQL Server 2005


Ashot Geodakov
10/1/2007 3:55:58 PM
What do you mean by "SQL Server does not let me do that"?

Can't you just execute the following statement,

insert into whatever_table( whatever_date_field ) values( cast( '01/01/1386'
as datetime ) )

?

[quoted text, click to view]


10/1/2007 4:06:41 PM
[quoted text, click to view]

You're really, *really* going to have better luck asking the question
on a SQL Server newsgroup.
Try any of the groups in the microsoft.public.sqlserver hierarchy.

Michael

10/1/2007 5:06:05 PM
On Oct 1, 2:55 pm, "Ashot Geodakov" <a_geoda...@nospam.hotmail.com>
[quoted text, click to view]

Nope. The range of SQL Server's datetime datatype is January 1, 1753,
through December 31, 9999. (1753 was the year the Gregorian calendar
was widely adopted).

Michael

Marc Gravell
10/1/2007 9:23:49 PM
Just a thought; store it in what the db (and indeed, .NET etc) is
happy with (i.e. Gregorian), but translate it at the presentation tier
through different validation / formatting.

At the end of the day, in the database it is only a number (well, set
of bytes of you take it too literally) - it only represents (say) a
Gregorian vs Hijri date/time value when you add context.

Marc
shahoo
10/1/2007 10:29:56 PM
Hi, I know this is not a good place for this post, but I have too.
I need to store Hijri Date in SQL Server 2005, but because it is year
1386 in Hijri calendar, SQL Server does not let me do that. I can
store it as simple text but it is not a good approach.
Can anyone help me please?
shahoo
10/2/2007 1:22:15 AM
[quoted text, click to view]

OK I will. Thanks for the help.
wisccal NO[at]SPAM googlemail.com
10/2/2007 4:53:02 AM
Check out

Hijri Dates in SQL Server 2000
http://www.microsoft.com/globaldev/DrIntl/columns/002/default.mspx

===================
Regards,
Steve
www.foxville.ch

[quoted text, click to view]

AddThis Social Bookmark Button