G
Guy Hocking
Hi there,
I have a problem in my ASP/SQL Server application i am developing, i hope
you guys can help.
I have a ASP form with list boxes populated by SQL tables. When a user
selects a value in a list box and submits the form the value is put into a
session variable and the relevant page is displayed (in accordance to one of
the list boxes).
The page is then displayed with the relevant SQL data. So far i have got the
data to be displayed without any filtering done in relation to the users
input.
What i am trying to do at the moment, and failing, is to issue a SELECT
statement initally, stating what columns are needed from a specific view in
SQL Server -
****
Set RS = DataConnection.Execute("SELECT vchrSolution_Name, vchrChannel,
intTotalSols FROM vw_SOLS_NationalCount_u ORDER BY vchrSolution_name,
vchrchannel")
****
For what i need to do, i need to now write an IF statement that only
displays what is in the session variable list box.
EG -
The list box "lstOFFER" contains the value "ALL", so all the data is
selected. Or it contains "OFFER" so all the records in the view column
vchrChannel that have OFFER in the column are selected.
And so on for several list boxes.
I realise this is not the most efficient way of doing this but it is the way
we have to do it :-(
Basically i need to know how to filter a SELECT statement in relation to
what is in the session variable list boxes, ideally a conditional SELECT
statement to minimise the data in the RecordSet.
I hope this makes sense....
sorry if i come accross nieve , (I am quite new to ASP/SQL application
development, thrown in at the deep end! best way to learn i guess!)
--
Guy
www.bradflack.com
Please remove ANTI and SPAM from my
email address before sending me an email.
I have a problem in my ASP/SQL Server application i am developing, i hope
you guys can help.
I have a ASP form with list boxes populated by SQL tables. When a user
selects a value in a list box and submits the form the value is put into a
session variable and the relevant page is displayed (in accordance to one of
the list boxes).
The page is then displayed with the relevant SQL data. So far i have got the
data to be displayed without any filtering done in relation to the users
input.
What i am trying to do at the moment, and failing, is to issue a SELECT
statement initally, stating what columns are needed from a specific view in
SQL Server -
****
Set RS = DataConnection.Execute("SELECT vchrSolution_Name, vchrChannel,
intTotalSols FROM vw_SOLS_NationalCount_u ORDER BY vchrSolution_name,
vchrchannel")
****
For what i need to do, i need to now write an IF statement that only
displays what is in the session variable list box.
EG -
The list box "lstOFFER" contains the value "ALL", so all the data is
selected. Or it contains "OFFER" so all the records in the view column
vchrChannel that have OFFER in the column are selected.
And so on for several list boxes.
I realise this is not the most efficient way of doing this but it is the way
we have to do it :-(
Basically i need to know how to filter a SELECT statement in relation to
what is in the session variable list boxes, ideally a conditional SELECT
statement to minimise the data in the RecordSet.
I hope this makes sense....
sorry if i come accross nieve , (I am quite new to ASP/SQL application
development, thrown in at the deep end! best way to learn i guess!)
--
Guy
www.bradflack.com
Please remove ANTI and SPAM from my
email address before sending me an email.