Forums

This topic is locked

Wildcard in Field Values

Posted 01 May 2004 22:11:40
1
has voted
01 May 2004 22:11:40 Charles Beaudry posted:
I'm working on a website that uses a ton of variables to display economic data.

One problem that I'm running into is the fact that certain exchange rates (like Turkey, Romania and Somalia) have sky high exchange rates and they are causing overflow errors in my online calculations.

Is it possible to have a wildcard within a variable being called from a database? For example, if my recordset calls these variables:

set1.Fields.Item("M04".value
set2.Fields.Item("M04".value
set3.Fields.Item("M04".value
set1.Fields.Item("F04".value
set2.Fields.Item("F04".value
set3.Fields.Item("F04".value

Can they all be replaced by one variable such as this:

set&.Fields.Item(&.value

If not, how would I go about achieving this since the number of exceptions that would have to be programmed in is totally ridiculous.

Thanks for any help.

Replies

Replied 02 May 2004 00:41:03
02 May 2004 00:41:03 Charles Beaudry replied:
After looking at all the possibilities, I realized that using wildcards (if even possible) wouldn't work.

So I made an if...then statement but it doesn't work.

Here's the code:
<b>
&lt;%
if ((Request.QueryString("countryID" = (114 or 135 or 152 or 171 or 182)) and (Session("c1" &lt;&gt; (114 or 135 or 152 or 171 or 182))) then

variableset1

elseif ((Request.QueryString("countryID" &lt;&gt; (114 or 135 or 152 or 171 or 182)) and (Session("c1" = (114 or 135 or 152 or 171 or 182))) then

variableset2

else

variableset3

end if </b>

So here's my problem.

If my QueryString = 171 and my Session(c1) = 135 then the "else" statement appears, which is what it is supposed to do.

However, if my QueryString = 171 and my Session('c1" = 30, it should lock in the first set of variables. But it doesn't. If gives me the third set also.

I thought that maybe the preponderence of "or"s in there was screwing things up but I tried various statements deleting and adding parentheses. I also tried adding and removing quotation marks around the values (which are country codes).

Can anyone see where this code is going wrong?

Edited by - cbeaudry on 02 May 2004 01:27:41

Edited by - cbeaudry on 02 May 2004 01:31:15

Reply to this topic