Help Needed(Query)

Results 1 to 2 of 2

Thread: Help Needed(Query)

  1. #1
    Join Date
    Dec 1969

    Default Help Needed(Query)

    HI All,<BR><BR>I am facing a problem actually i had developed timesheet module and now i want to use query for administrator use depending on the start date and end date it should show the relevant information from that table and for that i am using one asp page from where i am selecting dates and in other page collecting values but i don&#039t know how to proceed i am placing the code below so could somebody look at it and give me some sugguestion.<BR>&#060;%<BR>str = CDate(request.form("ma")& "/" &request.form("mb") & "/" & request.form("mc"))<BR>strTemps = CDate(request.form("b1")& "/" &request.form("b2") & "/" & request.form("b3"))<BR>Set Con=Server.CreateObject("ADODB.Connection")<BR>Con .Open("Driver={SQL Server}; Server=webservernew;uid=sa;pwd=;DATABASE=timesheet ")<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>RS.Curso rType = adOpenStatic<BR>RS.Open "SELECT User_Name, sDate, Activity, Duration, Process_id, Reviewed FROM EmpTrans WHERE sdate &#062;=&#039"& str &"&#039 & sdate &#060;="&#039 & strtemps & "&#039 ORDER BY User_Name"&#039"Con<BR><BR>if RS.EOF then<BR> Response.Write "No records"<BR>else<BR> Response.Write "Records Retrieved"<BR>end if<BR>%&#062;<BR>

  2. #2
    Normand Guest

    Default RE: Help Needed(Query)

    you could do it like this "SELECT [your field] from [your table]<BR>where date between #" & start_date &"# AND #" & END_date & "# ORDER BY [your field]" <BR>this way you would have all record between date if you want to add restriction like with a given name or else just add something<BR>like "AND [field] = [your string]"<BR>hope it help<BR>Normand<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts