ASP/SQL DropDown question

Results 1 to 2 of 2

Thread: ASP/SQL DropDown question

  1. #1
    Join Date
    Dec 1969

    Default ASP/SQL DropDown question

    I have a drop down menu that displays dates from a dateSubmitted field. My Select statement pulls out only the date portion of the date/time field and displays only one date if there are multiple entries. <BR><BR>It displays the date correctly in the drop down. Now, my problem is this, once a specific date is selected, which there may be many of, it will not select the information from the database because it is looking for the time portion of the field. If I delete the time from the database, all of the proper information is displayed. <BR><BR>This is my code:<BR><BR>Set rstPDF = cnn.Execute("SELECT Distinct(CONVERT(VARCHAR)10),dateSubmitted,101))as dateSubmitted FROM applicant Where pdfPrinted = 0") <BR> <BR>%&#062;&#060;option value=&#039;&#039;&#060;% If strpdfDate = "" Then Response.Write("selected") %&#062;&#062;Select &#060;/option&#062;&#060;% <BR> <BR>While NOT rstPDF.EOF <BR> <BR>%&#062;&#060;option value=&#039;&#060;%= rstPDF("dateSubmitted") %&#062;&#039;&#060;% If Trim( rstPDF("dateSubmitted") ) = Trim( strpdfDate ) Then Response.Write("selected") %&#062;&#062;&#060;%= Trim( rstPDF("dateSubmitted") ) %&#062;&#060;/option&#062;&#060;%<BR><BR>rstPDF.MoveNext<BR><BR> Wend<BR>Set rstPDF = Nothing<BR><BR>So when my date is selected, I need it to go back to the database, look at the date and take all entries with that date and display it. <BR><BR>I have the display portion working properly, it is only getting it to select the proper information. <BR>Thank you in advance for any help! It is greatly appreciated.<BR><BR>-------<BR>Putzy<BR>

  2. #2
    Join Date
    Dec 1969

    Default try simplifying your select

    select datesubmitted from applicant Where pdfPrinted = 0<BR><BR>then ensre you are select correctly from the selected deal.<BR><BR>SQL:<BR>select * from application where datesubmitted=&#039;" & request("datesubmitted") & "&#039;"<BR><BR>Access<BR>select * from application where datesubmitted=#" & request("datesubmitted") & "#"<BR><BR>What would be IDEAL would be if you could select a distinct ID field to select, and pass a smaller element (like a counter or something a little more ordinal)<BR><BR>Whol.

Posting Permissions

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