mosArt
asked on
select between dates microsoft sql / c#
Cat get this select statement to work:
string commandStr2 = "Select * From [Items] Where [ItemTypeID] = 1 AND ([ItemStartDate] between convert(datetime, '11/12/2004') and convert(datetime,'12/12/20 07') )";
the string returns no results...
string commandStr2 = "Select * From [Items] Where [ItemTypeID] = 1 AND ([ItemStartDate] between convert(datetime, '11/12/2004') and convert(datetime,'12/12/20
the string returns no results...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi,
can you try following
string commandStr2 = "Select * From [Items] Where [ItemTypeID] = 1 AND (convert(varchar,[ItemStar tDate],103 ) between
convert(varchar, '11/12/2004',103) and convert(varchar,'12/12/200 7',103) )";
thanks,
satish
can you try following
string commandStr2 = "Select * From [Items] Where [ItemTypeID] = 1 AND (convert(varchar,[ItemStar
convert(varchar, '11/12/2004',103) and convert(varchar,'12/12/200
thanks,
satish
have you tried :
string commandStr2 = "Select * From [Items] Where [ItemTypeID] = 1 AND [ItemStartDate] between '2004/11/12' and '2007/12/12'";
Cheers!