Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Help with SQL query, (please)

Thread Tools
 
Search this Thread
 
Old 23 January 2003, 09:12 AM
  #1  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Question

Can someone tell me what's wrong with this query? I'm a beginner when it comes to SQL, so please be kind

SqlJunk = "SELECT * FROM results WHERE " & strVar & " = '" & strQuery & "' AND WHERE id = '" & id & "' ORDER BY record"

I'm getting the error message: Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'WHERE'.
/new_cit/risk/edit2/searchquery.asp, line 31
Old 23 January 2003, 09:15 AM
  #2  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

Sorted. The second 'WHERE' was the problem
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
ALEXSTI
General Technical
5
28 September 2015 09:29 PM
Ozne
General Technical
2
27 September 2015 03:06 PM
stevem2k
Non Scooby Related
8
06 July 2011 11:11 PM
Mkhan
Non Scooby Related
14
09 August 2001 02:07 AM
SDB
Non Scooby Related
2
26 May 2001 11:55 PM



Quick Reply: Help with SQL query, (please)



All times are GMT +1. The time now is 05:33 PM.