Discussion Locked

SQL Syantax

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi gud pm to everyone, my problem is that there is an error when i use a sql. i need a example on how to make a query., my query i this:

**** my query sample ***
my_str = "Select ntransaction_id, count(nqty) AS mycount from tr_daily where ntransaction_id = " & int(label1.caption)
*****
when i run the qry in VB6 there's an error on ntransaction_id? They say that ntransaction_id is not included. could please help me what seems to be the problem. just put my sample query in one line so that you'll understand. your help will give me some knowledge about it. tnx tnx tnx.. i have only 45 techpoints left so i'll give it all. thank you very much

2 replies

by s_hunnicutt

in your query "Select ntransaction_id, count(nqty) AS mycount from tr_daily where ntransaction_id = " & int(label1.caption) try changing "ntransaction_id, count(nqty) AS mycount" to *

by s_hunnicutt

in your query "Select ntransaction_id, count(nqty) AS mycount from tr_daily where ntransaction_id = " & int(label1.caption) try changing "ntransaction_id, count(nqty) AS mycount" to * Sorry one more thing since you are saying ntransaction_id = " & int(label1.caption) make sure that int(label1.caption)is actually working

This discussion is closed to new replies.