473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Store Date/Time in SQL Server 2005

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?

Oct 1 '07 #1
6 6600
shahoo wrote:
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?
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

Oct 1 '07 #2
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 ) )

?

"shahoo" <sh************@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
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?

Oct 1 '07 #3
On Oct 1, 2:55 pm, "Ashot Geodakov" <a_geoda...@nospam.hotmail.com>
wrote:
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 ) )

?
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
Oct 2 '07 #4
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
OK I will. Thanks for the help.

Oct 2 '07 #5
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

Oct 2 '07 #6
Check out

Hijri Dates in SQL Server 2000
http://www.microsoft.com/globaldev/D...2/default.mspx

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

On Oct 2, 3:22 am, shahoo <shahookaman...@gmail.comwrote:
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

OK I will. Thanks for the help.

Oct 2 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew DeFaria | last post by:
I have the following php code: function Today2SQLDatetime () { $today = date ("Y-m-d H:i:s"); print "date (\"Y-m-d H:i:s\") returned $today<br>"; return $today; return date ("Y-m-d H:i:s"); }...
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
7
by: Marc Pelletier | last post by:
Hello, I have a table with a Day field, defined as smalldatetime. I am filling it from a CSharp application with the following code: DataRow r = dtStaDays.NewRow(); r= station_ID; r =...
3
by: ExclusiveResorts | last post by:
Can the CallContext be used reliably for storing request specific data? We are developing an application library that uses the CallContext to keep an IdentityMap (hashtable of business objects...
3
by: Hans Merkl | last post by:
Hi, I am helping to build a web app that's pretty much a wrapper around a web service. The question now is how to store the handle of the web service object between requests. My client is using...
4
by: franco | last post by:
I am a beginner in programming. How can I display the system date - 5 December 2005 in my webpage.
1
by: serge | last post by:
Right now the database I am working with is storing time in an Integer data type and is storing the time value in seconds. The application does not allow entering seconds. It accepts minutes and...
3
by: Larry Bertolini | last post by:
For some reason, I recall having read that SQL Server 2005 would support a datatype that represented date, but not time. (This would be useful for storing things like birthday, where you usually...
10
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.