Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Query in Ultradev

Status
Not open for further replies.

KMarshall

Technical User
May 25, 2001
12
GB
I have a form that has three fields

txtAccount (Account Number)
mnuCriteria (either = < or >)
txtInvoiceNo (1 to whatever)

I want the user to be able to key in an account number in the textbox txtAccount, then select from the dropdown menu mnuCriteria either = < or > then key in an invoice number in the textbox txtInvoiceNo.

I cant get dreamweaver to accept my SQL statement as I have two variables next to eachother in the statment as follows

SELECT Account, InvoiceNo
FROM DBA_HLG01_HAJobFile
WHERE Account LIKE 'varAccount' AND InvoiceNo &quot;varCriteria&quot; &quot;varInvoiceNo&quot;

My Variables have been set up as follows

varAccount % Request(&quot;txtAccount&quot;)
varCriteria % Request(&quot;mnuCriteria&quot;)
varInvoiceNo % Request(&quot;txtInvoiceNo&quot;)

I get the message Syntax error (missing operator) in Query Expression Account LIKE '%' AND InvoiceNo [%][%]'

Im very new to this so if its obvious, forgive me. I'd really appreciate the help though!

Thanks for your time.
Kevin Marshall.
 
Try this:

SELECT Account, InvoiceNo
FROM DBA_HLG01_HAJobFile
WHERE Account LIKE '&quot; & varAccount & &quot;' AND
InvoiceNo &quot; & varCriteria & varInvoiceNo & &quot;;&quot;

The way you were doing it was not getting ASP to interpret the variables, it would be seeing the words literally. Steve Davis
hey.you@hahaha.com.au
 
I'm new to this also and I as wondering what your &quot;&'s&quot; do in the above SQL statement.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top