Query
-
Hi I have an sql Query to select 2 different date.. "select * from offerdate >= '31/02/2006' and offerdate <= '04/04/2007' " ... this query does not take the TO date (04/04/2007) if i give the next day date the '05/04/2007' then it is taken.... help .... thanks in advance
-
Hi I have an sql Query to select 2 different date.. "select * from offerdate >= '31/02/2006' and offerdate <= '04/04/2007' " ... this query does not take the TO date (04/04/2007) if i give the next day date the '05/04/2007' then it is taken.... help .... thanks in advance
hi, try with .. select * from convert(fromdate,datetime,101)>='02/31/2006' and convert(todate,datetime,101)>='04/04/2006' and regards
jijo jose
-
Hi I have an sql Query to select 2 different date.. "select * from offerdate >= '31/02/2006' and offerdate <= '04/04/2007' " ... this query does not take the TO date (04/04/2007) if i give the next day date the '05/04/2007' then it is taken.... help .... thanks in advance
DateTime data type stores both date and time. when data is given like '04/04/2006' is taken as 04/04/2006 0hrs 0min that is why dates stored having time greater than 0hrs are not listed. solution : 1. take dd, mm, yyyy seperately from the column 2. concatenate them into one string 3. convert to datetime using CONVERT function CONVERT (data_type [(length)], expression [, style]) OR you can use the next date as you have already did.
Regards KP
-
hi, try with .. select * from convert(fromdate,datetime,101)>='02/31/2006' and convert(todate,datetime,101)>='04/04/2006' and regards
jijo jose
hi jo I want the sqlquery in dmy format.... i used setdateformat dmy ; and my sql query..