sql query error

Thread Solved

Join Date: Aug 2007
Posts: 76
Reputation: anto_nee is an unknown quantity at this point 
Solved Threads: 4
anto_nee anto_nee is offline Offline
Junior Poster in Training

sql query error

 
0
  #1
Aug 30th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: sql query error

 
0
  #2
Aug 30th, 2007
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.
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: sql query error

 
0
  #3
Aug 31st, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 76
Reputation: anto_nee is an unknown quantity at this point 
Solved Threads: 4
anto_nee anto_nee is offline Offline
Junior Poster in Training

Re: sql query error

 
0
  #4
Sep 3rd, 2007
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC