Dates in a DropDownList

Results 1 to 2 of 2

Thread: Dates in a DropDownList

  1. #1
    Join Date
    Dec 1969

    Default Dates in a DropDownList

    i have 2 DropDownLists named "ddlStartDate" and "ddlEndDate". both are populated via DataReaders from the same query in an Access database. the query returns DISTINCT dates found in the records of the queried table.<BR><BR>the goal of the page is to have the user select a "start date" (ddlStartDate.SelectedItem.Value) and an "end date" (ddlEndDate.SelectedItem.Value), and generate a report between the "start" and "end" dates.<BR><BR>the best i can figure, the report generator is looking at the "start" and "end" dates as TEXT; thus, the report lists records as follows:<BR><BR>StartDate: 1/1/1996<BR>EndDate: 12/31/2002<BR><BR>report results:<BR><BR>1/1/1996<BR>1/1/1997<BR>1/1/1998<BR>1/1/1999<BR>1/1/2000<BR>1/1/2001<BR>1/1/2002<BR>1/2/1997<BR>1/2/1998<BR>1/2/1999<BR>1/2/2000<BR>1/2/2001<BR>1/2/2002<BR>1/3/1997<BR>1/3/1998<BR>1/3/1999<BR>1/3/2000<BR>(etc...)<BR><BR>i guess the main question is "how do i convert the &#039;ddlStartDate.SelectedItem.Value&#039; TEXT string back into a date"?<BR><BR>much appreciated.<BR><BR>chuck

  2. #2
    Join Date
    Dec 1969

    Default CDate()

    MyStartDate = CDate(ddlStartDate.SelectedItem.Value)<BR><BR>Is that all you are asking?

Posting Permissions

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