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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Passing Datetime value to Sql Server 2000

Author  Topic 

WaleedSeada
Starting Member

2 Posts

Posted - 2006-07-09 : 09:20:39
Hello all
I have a problem passing datetim value [09-07-2006] to sql server 2000, I debuge the problem and found sql server interprut it as [07-09-2006]
How can I force Sql-Server to use "dmy" to interprut this value, I have tried set dateformat [dmy] but it doesn't work ...

any help !!!
thanks and best regrads
Waleed Seada

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-09 : 09:41:23
pass the data as a datetime or as character in the format yyyymmdd.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-07-09 : 11:30:34
What i do is to set a default value and increment the difference between the remote server and the client. As getdate() + 'difference'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-10 : 02:38:17
http://www.sql-server-performance.com/fk_datetime.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

WaleedSeada
Starting Member

2 Posts

Posted - 2006-07-12 : 06:05:36
I am passing the value as datetime to the stored procedure field which is also datetime, is this related to the front-end, ca I control it from there ...

Thanks and bst regrds
Waleed
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-12 : 06:25:16
In that case it's a front end problem not sql server.
The datetime is just a number so can't suffer from local problems.
When you convert your character value to a datetime in the client it is getting it wrong.

If you can't solve that then you can send to sql server as a character string as yyyymmdd instead of a datetime and it will implicitly convert correctly.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -