lucky20
November 11, 2010, 9:21pm
1
I have a problem with the sql statement…
I am passing values from form.
item=request.form(“oitem”)
sql="select * from recipt a,invtrecipt b where a.reciptid=b.reciptid order by recipt_name =‘“& item &”’"
Set rs=con.Execute(sql)
error message:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ‘=’.
Same sql statement is executing and giving output in sql server…
When it comes to ASP the item value is not accepting…
is anything wrong with my sql query…
r937
November 11, 2010, 9:31pm
2
yes
what you need to do is construct the SQL statement with actual values, and then test it right in the database (use sqlserver management studio or whatever you have), not via asp
i think you will find the error message informative
lucky20
November 11, 2010, 9:50pm
3
hmm…
yes …
Problem with my sql statement…
r937
November 11, 2010, 10:02pm
4
and the error message is … ?
Are you becoming like Confucius these days, Rudy?
lucky20
November 12, 2010, 6:53pm
6
I have used Joins …Then it is working fine
table1: recipt
itemid
item
recipeid(PK)
table2:invtrecipt
item1
recipeid(fk)
sql=“select a.itemid,a.item,b.item1 from recipt as a JOIN invtrecipt as b ON
(a.recipid=b.recipid) where item='”& item &“'”