jayeshp100 Posted November 19, 2005 Share Posted November 19, 2005 Hi ive got this query below and the table is in SQL Plus,select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05'and e.dvd_id = d.dvd_idgroup by d.dvd_id, e.titleorder by sum(d.price) descI want to use ASP to simply display the contents in a table using ASP, i know how to do this, but this is a long query how do i insert this query into the ASP, i tried to put it on multiple lines but at the end of the first line theres an error how do i make it so it reads the whole query. Link to comment Share on other sites More sharing options...
kansasprog Posted November 20, 2005 Share Posted November 20, 2005 Hi ive got this query below and the table is in SQL Plus,select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05'and e.dvd_id = d.dvd_idgroup by d.dvd_id, e.titleorder by sum(d.price) descI want to use ASP to simply display the contents in a table using ASP, i know how to do this, but this is a long query how do i insert this query into the ASP, i tried to put it on multiple lines but at the end of the first line theres an error how do i make it so it reads the whole query.<{POST_SNAPBACK}> Assuming you are asking to concatenate your sqlstatement in vbscript.. Look the sample below.. use _ at end of first line and an & at the start of second line.strSQL = "select sum(d.price), e.Title, d.dvd_id"_&"from dvd_rental d, dvd_details e"_&"where ORDER_DATE between '4-NOV-04' and '04-NOV-05'"_&"and e.dvd_id = d.dvd_id"_&"group by d.dvd_id, e.title"_&"order by sum(d.price) desc" Link to comment Share on other sites More sharing options...
jayeshp100 Posted November 20, 2005 Author Share Posted November 20, 2005 Assuming you are asking to concatenate your sqlstatement in vbscript.. Look the sample below.. use _ at end of first line and an & at the start of second line.strSQL = "select sum(d.price), e.Title, d.dvd_id"_&"from dvd_rental d, dvd_details e"_&"where ORDER_DATE between '4-NOV-04' and '04-NOV-05'"_&"and e.dvd_id = d.dvd_id"_&"group by d.dvd_id, e.title"_&"order by sum(d.price) desc"<{POST_SNAPBACK}> Im not using vbscript, just standard SQL, would the above solution be the same. Link to comment Share on other sites More sharing options...
kansasprog Posted November 21, 2005 Share Posted November 21, 2005 Im not using vbscript, just standard SQL, would the above solution be the same.<{POST_SNAPBACK}> ok... You want to query a database and show all the results in a table in asp( I assume u mean active server pages).Do you know what language are you writing your asp pages?If you are writing in VbScript... , set your connectionset your recordset set your sqlstatement. ( if your sql statement has multiple lines use the above syntax)query the database. get the results of the query in a recordset. loop through the recordset to write to a page. Link to comment Share on other sites More sharing options...
jayeshp100 Posted November 21, 2005 Author Share Posted November 21, 2005 ok... You want to query a database and show all the results in a table in asp( I assume u mean active server pages).Do you know what language are you writing your asp pages?If you are writing in VbScript... , set your connectionset your recordset set your sqlstatement. ( if your sql statement has multiple lines use the above syntax)query the database. get the results of the query in a recordset. loop through the recordset to write to a page.<{POST_SNAPBACK}> Im using html Link to comment Share on other sites More sharing options...
jayeshp100 Posted November 21, 2005 Author Share Posted November 21, 2005 thank for your help, problem now sorted Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now