rsYear1.Open "select count(ComplaintNo) from tblcomplaint where year(cDate) ='" + Year(DTPicker1.Value) + "'", ConSQL, adOpenDynamic, adLockOptimistic

hi if u find any fault here

reply me immediately

rsYear1.Open "select ComplaintNo from tblcomplaint where cDate ='" + DTPicker1.Value+ "'", ConSQL, adOpenDynamic, adLockOptimistic

i already try this also

plzzzzzzzzzz

Hi,

What is the problem you are facing ... As syntax I don't see any mistake. If you are retriving wrong records try to format the value of the date picker.

Hi Anto_nee,

Year(SomeDate) Returns a Numeric value, so, u dont have to wrap it with single quotes.. Check this :

rsYear1.Open "select count(ComplaintNo) from tblcomplaint where year(cDate) =" & Year(DTPicker1.Value) , ConSQL, adOpenDynamic, adLockOptimistic

REgards
Veena

yah fine to all

i found the prob before reach here

Kb.net u r absolutely correct

i just format that date

thanks for the reply