Date Problem : Urgent
-
I have a problem with one of my sql query Start Date is 10/11/2007 (dd/mm/yyy format) End Date :10/12/2007 I have to get all dates listed from 11/11/2007 to 9/12/2007 (all dates between Start Date & End Date Pls help me...
Sunil Nair
-
I have a problem with one of my sql query Start Date is 10/11/2007 (dd/mm/yyy format) End Date :10/12/2007 I have to get all dates listed from 11/11/2007 to 9/12/2007 (all dates between Start Date & End Date Pls help me...
Sunil Nair
select * from table1 where mydate between @startdate and @enddate
. Take a look at UTC and datetime formats to make sure that you are working with your date properly (you are using a stored procedure aren't you - and you are passing @startdate and @enddate in as datetime). -- modified at 4:36 Tuesday 13th November, 2007 Ah - I see from others that you are trying to solve a different problem. Oh well.:^)Deja View - the feeling that you've seen this post before.
-
I have a problem with one of my sql query Start Date is 10/11/2007 (dd/mm/yyy format) End Date :10/12/2007 I have to get all dates listed from 11/11/2007 to 9/12/2007 (all dates between Start Date & End Date Pls help me...
Sunil Nair
Hi, Use DATEADD function. For details: http://msdn2.microsoft.com/en-us/library/aa258267(sql.80).aspx[^] And place a loop with a check, if equals the end date, stop. Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
I have a problem with one of my sql query Start Date is 10/11/2007 (dd/mm/yyy format) End Date :10/12/2007 I have to get all dates listed from 11/11/2007 to 9/12/2007 (all dates between Start Date & End Date Pls help me...
Sunil Nair
hi while @fromdate<=@todate begin print dateadd(day,1,@fromdate) set @fromdate=dateadd(day,1,@fromdate) end try this Regards Joe
-
select * from table1 where mydate between @startdate and @enddate
. Take a look at UTC and datetime formats to make sure that you are working with your date properly (you are using a stored procedure aren't you - and you are passing @startdate and @enddate in as datetime). -- modified at 4:36 Tuesday 13th November, 2007 Ah - I see from others that you are trying to solve a different problem. Oh well.:^)Deja View - the feeling that you've seen this post before.
Pete, Unless and untill we get to know what solution was exactly required, we are not very sure of the problem. :) Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.