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 2005 Forums
 Analysis Server and Reporting Services (2005)
 problem with date

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2007-08-01 : 05:57:31
hi,

when making a report, i prompt user to insert the date (1999/12/31), but i would like to insert it in 31/12/1999 format.

how can i do this?

i've tried:
date between convert(varchar(10), @date1, 103) and convert(varchar(10), @date2, 103)

but it still replaces month with day; e.g.: 3.jan.1997 would be 1.mar.1997.

thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-01 : 06:33:03
set dateformat dmy

select ...
from ...
where date >= cast(@datum2 as datetime)




E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2007-08-01 : 06:54:58
peso: i need to insert two dates

date1 and date2 eg.: 1.7.1999 and 1.8.1999

but it's working!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-01 : 07:09:16
Always use proper DATETIME datatype and let front end application do the formation

Madhivanan

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

- Advertisement -