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
 Site Related Forums
 Site Related Discussions
 date problems

Author  Topic 

markk
Starting Member

1 Post

Posted - 2004-12-06 : 06:19:50
Hi I have a date format problem. I am producing a calendar of events. ASP passes a short date as a string to SQL Server

quote:
"SET DATEFORMAT dmy SELECT project.id AS pid,* FROM project_date,project WHERE project_date.cms_id=project.cms_id AND project_date.dfrom<'"&dteDate&"' AND project_date.dto>'"&dteDate&"' ORDER BY strand,dfrom"


my problem is that 02/01/2005 returns 1st of February whilst 18/01/2005 returns the 18th of January!!!

any help would be greatly appreciated, I'm completely stumped.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-12-06 : 06:33:42
pass them as iso standard: yyyymmdd
then you'll have no problem.
the thing that happens to you now is probably becasue of user defined locale's.

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -