943,929 Members | Top Members by Rank

Ad:
Aug 30th, 2007
0

sql query error

Expand Post »
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
Similar Threads
Reputation Points: 12
Solved Threads: 4
Junior Poster in Training
anto_nee is offline Offline
76 posts
since Aug 2007
Aug 30th, 2007
0

Re: sql query error

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.
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Aug 31st, 2007
0

Re: sql query error

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Sep 3rd, 2007
0

Re: sql query error

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
Reputation Points: 12
Solved Threads: 4
Junior Poster in Training
anto_nee is offline Offline
76 posts
since Aug 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Taking inputs 4m autocad drawings,possible?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How to Define size of variable string during runtime





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC