Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
s_anr
Yak Posting Veteran
81 Posts |
Posted - 2009-06-09 : 02:49:41
|
| Hi SQL Gurus,I have created a SQLview from a query which would reveal the following results from the server "my-server" with UN = user and password = pwd :Ticket Open_Date Close_Date Group12345 12-05-2009 00:12:00 12-05-2009 00:15:00 SQL 45678 12-05-2009 00:12:00 12-05-2009 00:15:00 TSQL 76890 13-05-2009 00:12:00 12-05-2009 00:15:00 MYSQL67900 13-05-2009 00:12:00 12-05-2009 00:15:00 SQL56789 14-05-2009 00:12:00 12-05-2009 00:15:00 TSQL 96789 14-05-2009 00:12:00 12-05-2009 00:15:00 SQL How can I create a webpage in ASP / JSP Page so that I can launch it in IIS and it should have four fields as given below :Open_Date(Initial) Open Date (End) Group GOWhen I enter the Open_Date(Initial) and Open_date (End), select a group from Drop down (e.g. SQL). It should give me all the ticket information (All rows from the table) where Open_date is in between the Dates specified. When I click on GO, I should be able to save it as an excel sheet. Any help would be appreciated. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-09 : 12:56:56
|
the webpage should be designed using your front end language like VB ASP,ASP.NET,... the backend query will be something likeSELECT *FROM TableWHERE Group='SQL'AND Open_date BETWEEN Open_Start_Date AND Open_End_Date for saving in excel you need to write code in your vb or asp |
 |
|
|
s_anr
Yak Posting Veteran
81 Posts |
Posted - 2009-06-09 : 15:06:37
|
| Yes I understand that I need to run this quey in the backend. But How do I link it in a webpage? This is where i'm stuck. I'm not a webdesigner but can work on SQL. I have posted this in this forum so that someone who knows SQL as well as web designing. Any help!!! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
Stevan2020
Starting Member
25 Posts |
Posted - 2009-07-23 : 14:50:14
|
| This example uses ASP and a DSN for the connection to the DB. You could change that to a DSNless conmnection.<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Set rsOffices_cmd = Server.CreateObject ("ADODB.Command")rsOffices_cmd.ActiveConnection = "dsn=yourDB;uid=yourID;pwd=yourPWD;"rsOffices_cmd.CommandText = "Select OfficeID, ShortOffice From tbl_Offices" rsOffices_cmd.Prepared = trueSet rsOffices = rsOffices_cmd.ExecutersOffices_numRows = 0%><table> <tr> <th>OfficeID</th> <th>Office</th> </tr> <% While NOT rsOffices.EOF %> <tr> <td><%=rsOffices("OfficeID")%></td> <td><%=rsOffices("ShortOffice")%></td> </tr> <% rsOffices.MoveNext()Wend%></table><%rsOffices.Close()Set rsOffices = Nothing%> |
 |
|
|
|
|
|