Followup Question

From: Rich Palarea (nospam_at_none.com)
Date: 06/22/04


Date: Tue, 22 Jun 2004 10:52:41 -0400

A followup question (sorry about re-using the original post):
The distinct function works well. I don't want to limit the chance of returning a record, so I'd like to offer the user the chance to select all records, in addition to being able to select the preferences they want (i.e.: no preference). To give you a better idea of how the sql is structured (MS Access db with .asp):

User can choose to find a group by three fields: GroupMix, MeetingDay, MeetingLocation from the table Smallgroups. All are dropdown fields in a form. GroupMix and MeetingLocation are populated by a SELECT statement to the Smallgroups table. MeetingDay is pre-populated with days of the week.

It is easy to get "no records found" with this setup, because of the limited number of records in the table at present. I would like the user to be allowed the choices of "no preference" inside of the three drop down fields.

Present SQL for the form (showing just the dropdown portion for GroupMix; there is a similar select for MeetingLocation further down in my page):

<% end if %>
<%
fp_sQry="SELECT Distinct Smallgroups.GroupMix FROM Smallgroups ORDER BY GroupMix ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="GFCData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="GroupMix"
fp_sMenuValue="GroupMix"
fp_sColTypes="&OrgID=3&Name=202&MeetingDay=202&MeetingLocation=202&GroupMix=202&MeetingTime=202&ChildrenAllowed=202&Status=202&ContactIndLabel=202&ContactHomePhone=202&ContactIndvEmail=202&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

Present SQL for the results page:
<% end if %>
<%
fp_sQry="SELECT * FROM Smallgroups WHERE (status = 'open' AND MeetingDay = '::MeetingDay::' AND GroupMix = '::GroupMix::' AND MeetingLocation = '::MeetingLocation::')"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="GFCData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&OrgID=3&Name=202&MeetingDay=202&MeetingLocation=202&GroupMix=202&MeetingTime=202&ChildrenAllowed=202&Status=202&ContactIndLabel=202&ContactHomePhone=202&ContactIndvEmail=202&"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>

Present working page: http://smallgroups.gfc.org/IDsite/locator.asp

Thanks!
Rich

"Rich Palarea" <nospam@none.com> wrote in message news:uS3mi8FWEHA.3024@TK2MSFTNGP09.phx.gbl...
> I'm using the Database Results Wizard to populate a dropdown list in a form.
> In this case, the field I'm pulling from is a city (text). At present, I'm
> getting every record in the dropdown. I only want the unique records. For
> example, if Los Angeles is listed in 200 records, I don't want 200 choices
> for Los Angeles in the dropdown...only one.
>
> Is there a parameter you can add to the sql of the Database Results Wizard
> or elsewhere in the .asp page that will only return the first value and skip
> the rest?
>
> Thanks in advance.
> Rich
>
>



Relevant Pages

  • Re: Using Database Results Wizard for dropdown
    ... Present SQL for the form (showing just the dropdown portion for GroupMix; ... > Is there a parameter you can add to the sql of the Database Results Wizard ...
    (microsoft.public.frontpage.programming)
  • RE: Looking for suggestions on populating dropdown from database table
    ... I can't figure out how to get the collection into the dropdown. ... > Public Function getKeyValueList(ByVal sql As String) As Collection ... readerCmd.Connection = readerConn ...
    (microsoft.public.dotnet.framework)
  • RE: Need some help with simple search query
    ... > dropdown with Resident's names and a dynamic dropdown with Appointment ... > search criteria, then it doesn't return any results. ... Here is my new query, ... > sql = blah,blah ...
    (microsoft.public.sqlserver.programming)
  • looking for a special kind of table control
    ... One is an SQL bound ... dropdown, another one a simple text item dropdown, the third one a numerical ... third column and each time the first or third column is being changed ... and finally a free form text entry field (just plain ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • SQL to allow a "no preference (all) choice
    ... can see, it is FrontPage generated sql, but can be edited with standard SQL ... User can choose to find a group by three fields: GroupMix, MeetingDay, ... MeetingLocation from the table Smallgroups. ... GroupMix and MeetingLocation are populated by a SELECT statement to ...
    (microsoft.public.inetserver.asp.db)