![]() |
Sergey Kornilov admin 3/8/2007 |
Try the following: Sub ListOnLoad() set rstmp = Server.CreateObject("ADODB.Recordset") rstmp.open "select [MetricDescription], [Month], [Year] from [dbo].[SS-Metrics-Totals] where [MetricDescription] = " & SESSION(strTableName & "_masterkey1"), dbConnection Session("MasterField1") = rstmp("Month") Session("MasterField2") = rstmp("Year") rstmp.close : set rstmp = nothing End Sub |
T
|
tgunther author 3/9/2007 |
Try the following:
Error number -2147217900 Error description [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='. URL /SSMetrics/SS-metrics_overview/SS-Metrics_Totals/SS_Metrics_Overview_list.asp SQL query select [MetricDecription], [MetricLevelDescription], [SiteLocation], [Budget], [Year], [Amount1], [Month], [UID], [MetricTypeDesc], [SiteUID], [TypeUID] From [dbo].[SS-Metrics_Overview] where ([dbo].[SS-Metrics_Overview].[MetricDecription]='Current Month Sales $K')
|
J
|
Jane 3/12/2007 |
If MetricDescription is the text field you need to use single quotes around it: Sub ListOnLoad() set rstmp = Server.CreateObject("ADODB.Recordset") rstmp.open "select [MetricDescription], [Month], [Year] from [dbo].[SS-Metrics-Totals] where [MetricDescription] = '" & Session(strTableName & "_masterkey1")&"'", dbConnection Session("MasterField1") = rstmp("Month") Session("MasterField2") = rstmp("Year") rstmp.close : set rstmp = nothing End Sub |
T
|
tgunther author 3/20/2007 |
If MetricDescription is the text field you need to use single quotes around it:
|