Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
select SUM(purchaseitem.total) ,distributordetail.distributingdate from ((purchaseitem Inner Join distributordetail on purchaseitem.serialno=distributordetail.serialno) WHERE distributordetail.distributingdate between '" + dateTimePicker1.Text + "'AND '" + dateTimePicker2.Text + "')"


what is wrong in this query
Posted
Comments
OriginalGriff 17-Dec-13 2:26am    
What do you expect it to do?

1 solution

You should tell us about the issue like error message or its related details. I took a glance & found

0) There's no space before AND keyword
1) You're filtering query based on dates so you need to use CAST/CONVERT for date related things in WHERE condition. OR you should use right Date format[^]
2) Use parameterized queries to avoid SQL injection[^]
3) Use Google based on the error message
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900