Variable table name in select clause

  • Thread starter Thread starter jhmosow
  • Start date Start date
J

jhmosow

I am trying to create an FP2K form that has radio buttons. Based upon
the value of the button selected, the query will run agains a different
table name. The group name for my button is R1. So I have tried the
following query:

SELECT Distinct EventID, EventCategoryName, Count(*) as NumberOfRecords
FROM '::R1::'
Group by EventID, EventCategoryName
ORDER BY EventID ASC,EventCategoryName ASC

As you can imagine, this does not work and errors. Any idea how I can
do this?

TIA
 
The FP DBRW does not support variable table names
- it requires a fixed predetermined table name

If you are hand coding your ASP and R1 is the radio button field name (w/ table names in the options)
Get the value of R1 before your select

<% strTable = Request.Form("R1") %>

<%
strSQL = "SELECT Distinct EventID, EventCategoryName, Count(*) as NumberOfRecords
FROM " & strTable & " Group by EventID, EventCategoryName ORDER BY EventID SC,EventCategoryName ASC"



--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am trying to create an FP2K form that has radio buttons. Based upon
| the value of the button selected, the query will run agains a different
| table name. The group name for my button is R1. So I have tried the
| following query:
|
| SELECT Distinct EventID, EventCategoryName, Count(*) as NumberOfRecords
| FROM '::R1::'
| Group by EventID, EventCategoryName
| ORDER BY EventID ASC,EventCategoryName ASC
|
| As you can imagine, this does not work and errors. Any idea how I can
| do this?
|
| TIA
|
 
Back
Top