NinjaTurtle
08-27-2004, 08:48 AM
Dear,
i will get the following SQL Statement from another asp page:
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and [issued by]='"&Session("User ID")&"' and status<>'Approved' ORDER BY [SO ID]"
From the above SQL statement, it will only show those Sales order which Issued by the particular user. But now i want to check if allow to view all Sales Order, then the SQL statement should be changed to
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and status<>'Approved' ORDER BY [SO ID]"
how to do it in ASP If then else statement?
If viewall=true then
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and status<>'Approved' ORDER BY [SO ID]"
else
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and [issued by]='"&Session("User ID")&"' and status<>'Approved' ORDER BY [SO ID]"
end if
i will get the following SQL Statement from another asp page:
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and [issued by]='"&Session("User ID")&"' and status<>'Approved' ORDER BY [SO ID]"
From the above SQL statement, it will only show those Sales order which Issued by the particular user. But now i want to check if allow to view all Sales Order, then the SQL statement should be changed to
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and status<>'Approved' ORDER BY [SO ID]"
how to do it in ASP If then else statement?
If viewall=true then
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and status<>'Approved' ORDER BY [SO ID]"
else
sql= "SELECT * FROM SalesOrder WHERE name like 'abc%' and [issued by]='"&Session("User ID")&"' and status<>'Approved' ORDER BY [SO ID]"
end if