View Full Version : How to Display records in table on selecting 1 item in Drop down dox in Sql Server?
chourasia
02-08-2005, 11:17 AM
Hi all!
Database used: Sql Server 2000.
1. I've to pull the values in the table (table2) when I select any one of the values in drop down box(table1). One field is common between these two tables?
How do I do it?
Please suggest.
2. Also I've to do the searching between two dates that's coming from the same column in the single table?
Please suggest.
jaywhy13
02-08-2005, 12:37 PM
Hello and welcome to Codigforums.com. Your first question I can see. Your question is a very big question coz I have no idea wot level of competence you are currently.
Lemme start with ques. 2:
Its just a matter of executing a sql statement using the Between command. Example...
"SELECT column_name FROM table_name WHERE column_name BETWEEN datevalue1 AND datevalue2"
This is discussed further here (http://www.w3schools.com/sql/sql_between.asp).
Your first question is not so clear to me. I think if I understand correctly you want to draw up a table based on a record chosen from a select box. Well if thats the case. If it to be done on the same page, then that would be a little more complex than you think. But if its just a matter of choosing a value, submitting it and then having it returned then its just a matter of evaluating request.form/queryString.
Do some reading on Sql, Ado and Asp... from W3Schools (an incredible resource)
Also.. doing a forum search before your post often does a world of good.
Sql Tutorial (http://www.w3schools.com/sql/)
ADO Tutorial (http://www.w3schools.com/ado/)
ASP Tutorial (http://www.w3schools.com/asp/)
Hope those help :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.