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 |
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2007-05-03 : 04:26:33
|
| Hi,Whether Hijiri (Arabic) date will accept by sql server??What I mean is, In my table the datatype for date field is datetime. But I need to enter some Hijiri (Arabic calender) dates like 01/11/1429 10:10:00 PM.But its not accepting...Showing error datetime field overflow.Is there anyway to add this?Wiht regardsShaji |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-03 : 04:42:18
|
| use datetime parameters instead of string contencation and you'll be ok._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2007-05-03 : 04:51:05
|
Thanks Mr.Spirit1,Could you explain it for me, How to do this or a URL link where its explained. PleaseThanksquote: Originally posted by spirit1 use datetime parameters instead of string contencation and you'll be ok._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp
|
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-03 : 04:53:18
|
| show us the code you're using_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2007-05-03 : 05:05:52
|
I did the query like this CID = replace(trim(request.form("Comp_ID")),"'","''") TID = replace(trim(request.form("LType_ID")),"'","''") ID = replace(trim(request.form("Issue_Date")),"'","''") [This Issue_Date is Arabic date] D = replace(trim(request.form("Duration")),"'","''") ED = cint(d) * 12 EmpID = replace(trim(request.form("Emp_ID")),"'","''") BN = replace(trim(request.form("Bank_Name")),"'","''") A = replace(trim(request.form("Amount")),"'","''") BID = replace(trim(request.form("Bank_Issue_Date")),"'","''") [This Bank_Issue_Date is Arabic date] BED = replace(trim(request.form("Bank_Expire_Date")),"'","''") [This Bank_Expire_Date is Arabic date] C = replace(trim(request.form("Comments")),"'","''") sql = ("insert into License values('" & LN & "'," & CID & "," & TID & ",'" & ID & "'," & D & ",DATEADD(mm, " & ED & ",'" & ID & "')," & EmpID & ",N'" & BN & "'," & A & ",'" & BID & "','" & BED & "',N'" & C & "')")With regardsShajiquote: Originally posted by spirit1 show us the code you're using_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp
|
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2007-05-03 : 05:17:11
|
we do the following things for accepting the hijri date. 1) We accept the date from the user in the Hijri format. 2) We convert the date format to the normal Geogorian date and then save them in the database. As our system is bilingual. To Convert From Hijri to Geogorian, the query should be like thisSELECT CONVERT(datetime, '16/04/1428', 131)To Convert from Geogorian to HijriSELECT CONVERT(nchar, GETDATE(), 131) Chiraghttp://chirikworld.blogspot.com/ |
 |
|
|
|
|
|
|
|