Jump to content

If problem


jteixeira
 Share

Recommended Posts

Hello,I have 1 table, 2 columns - desc and barcodeIn the barcode column I products CAP-..... and RES-....I want to make a condition if i select 1, list all products with CAP and 2, list all the products with RESMore or less this:variable->kif k=1 select all from infor where desc like 'CAP%'if k=2 select all from infor where desc like 'RES%'

Link to comment
Share on other sites

variable->kif k=1select * from inforwhere descricao like 'CAP%'if k=2select *from inforwhere descricao like 'RES%'
Is that code you are running? I thought it was pseudo-code, to illustrate what you want to do. Is that actual code you are trying to run? What are you trying to run it on? What database are you using?
Link to comment
Share on other sites

  • 2 weeks later...

You'll probably want to use something like PHP or ASP to run a different query based on the variable.

if (k == 1)  recordset.Open("SELECT * FROM infor WHERE descricao LIKE 'CAP%'");else  recordset.Open("SELECT * FROM infor WHERE descricao LIKE 'RES%'");

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...