为什么Request.QuerySting被视为一个数字? [英] Why is Request.QuerySting being treated as a number?
问题描述
嗨:
我有以下内容:
NRYear = Request.QueryString(" nryear")
我假设会导致NRYear包含一个字符串。
然而,当我用1/1 /连接它时,我得到了 1/1 / + 2003"好像
NRYear就是一个数字。
最后,这将是一个SQL字符串,如
SQL =" select * from newsreleases where nrdate between 1/1/2003 and
12/31/2003;"
我希望来自Request.QueryString作为用户'
选择的年份。
帮助!耗尽了想法,
Jules
Hi:
I have the following:
NRYear = Request.QueryString("nryear")
which I assumed would result in NRYear containing a string.
However, when I concatenate it with "1/1/", I get "1/1/+2003" as if
the NRYear is a number.
Ultimately, this will go in a SQL string such as
SQL = "Select * from newsreleases where nrdate between 1/1/2003 and
12/31/2003;"
and I want the year to come from the Request.QueryString as the user''s
selection.
Help!!! Running out of ideas,
Jules
推荐答案
你是如何连接的?你显然也在那里连接一个+
。要么是,要么+在你的查询字符串值中。
Ray在工作
Jules <菊************* @ ndm.gov.on.ca>在留言中写道
news:f5 ************************** @ posting.google.c om ...
And how are you concatenating? You''re apparently also concatenating a "+"
in there. Either that, or the + is in your querystring value.
Ray at work
"Jules" <ju*************@ndm.gov.on.ca> wrote in message
news:f5**************************@posting.google.c om...
嗨:
我有以下内容:
NRYear = Request.QueryString(" nryear")
我假设会导致NRYear包含一个字符串。
然而,当我将它与1/1 /连接时,我得到1/1 / + 2003。好像
NRYear是一个数字。
最终,这将进入一个SQL字符串,如
SQL =" Select * from newsreleases nrdate between 2003年1月1日和
12/31/2003;
我想要将年份作为用户的选择来自Request.QueryString。
帮助!!!耗尽了想法,
Jules
Hi:
I have the following:
NRYear = Request.QueryString("nryear")
which I assumed would result in NRYear containing a string.
However, when I concatenate it with "1/1/", I get "1/1/+2003" as if
the NRYear is a number.
Ultimately, this will go in a SQL string such as
SQL = "Select * from newsreleases where nrdate between 1/1/2003 and
12/31/2003;"
and I want the year to come from the Request.QueryString as the user''s
selection.
Help!!! Running out of ideas,
Jules
>但是,当我将其与1/1 /连接时,我得到1/1 / + 2003。好像
> However, when I concatenate it with "1/1/", I get "1/1/+2003" as if
NRYear是一个数字。
the NRYear is a number.
你能否展示你用来连接的代码?
Could you possibly show the code you are using to concatenate?
这不会发生在我身上。
sYear =" 2003"
Response.write" 1/1" ; &安培; sYear
导致预期的1/1/2003
请告诉我们如何重现您的问题。
Bob Barrows
Jules写道:
That does not happen to me.
sYear = "2003"
Response.write "1/1" & sYear
results in the expected "1/1/2003"
Please show us how to reproduce your problem.
Bob Barrows
Jules wrote:
嗨:
我有以下内容:
我认为会导致NRYear包含一个字符串。
然而,当我连接它时使用1/1 /,我得到1/1 / + 2003好像
NRYear是一个数字。
最终,这将进入一个SQL字符串,如
SQL =" Select * from newsreleases nrdate between 2003年1月1日和
12/31/2003;
我想要将年份作为用户的选择来自Request.QueryString。
帮助!!!耗尽了想法,
Jules
Hi:
I have the following:
NRYear = Request.QueryString("nryear")
which I assumed would result in NRYear containing a string.
However, when I concatenate it with "1/1/", I get "1/1/+2003" as if
the NRYear is a number.
Ultimately, this will go in a SQL string such as
SQL = "Select * from newsreleases where nrdate between 1/1/2003 and
12/31/2003;"
and I want the year to come from the Request.QueryString as the user''s
selection.
Help!!! Running out of ideas,
Jules
这篇关于为什么Request.QuerySting被视为一个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!