hi,
am having a dropdownlist of months(jan....dec). based on selection i wanted to retrive data from databse, but the field to check for a particular month is VDATE in nvarchar(50). empty dates are inserted as 0, and inserted dates are 1/3/2007. i wanted to retrieve other data. how is it possible to check for a particular months.
eg: select details1,details2 from ctable where DATEPART(MONTH,VDATE)=@mnth
invalid cast operation
TracyPosted Dec 24, 2007, 6:13 AM
{
string[] split = strConn.Split(new char[] {'/'});
string s;
foreach ( s in split)
{
if (s.Trim() != "")
{
}
}
MessageBox.Show(Strings.split(1).ToString());
}
catch (Exception ex)
{
}
Cheers !!
Tracy
sa sanPosted Dec 24, 2007, 5:38 AM
if the datatype value is nvarchar(50), then how could i split . the problem with datetime datatype is i cannot entry empty datetime, instead if datetime is not entered am sending 0 ,instead of null.so am storing in string, just given me to split the datetime value.
thanku 4ur response
TracyPosted Dec 24, 2007, 4:45 AM
Change the datatype and try this
SELECT stor_id AS EXPR1, ord_num AS EXPR2, ord_date AS EXPR3
FROM dbo.sales
where MONTH( ord_date ) = 3
Hope this helps :)
Tracy