sa san

sa san

  • NA
  • 23
  • 0

need a help with datepart function

Dec 24 2007 3:18 AM

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


Answers (3)