Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Makes No Sense

Status
Not open for further replies.

bongmarley

Programmer
Oct 21, 2002
74
CA
I have two record sets with almost identicle syntax one works and one doesn't.

I have this first
set getPercentage=con.execute("select * from Global where recDate="&request("theDATE")&"and school='"&session("account") &"' and profNo="&request("profNo"))


then about 10 lines later I have this
set getPercentage=con.execute("select * from Global where recDate="&request("theDate")&"and school='"&session("account") &"'")

The first one works but the second does not. The Date request variable in the second piece of code seems to have all value how is that possible?
 
See the section "Reference 10" in this FAQ: faq333-3048

-pete

 
I response.write it and get value of nothing for request("theDate").
I could put the two sql statements one under the other. The first brings me a request("theDate") as a date
and the second brings me nothing. Does the first one erase the variable of any value.
 
set a variable to the request value and use that in your page. don't request the same thing twice

_________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
that was not the fix but what you should do.

try reference 8 in the FAQ also

_________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
>> get value of nothing for request("theDate").

If that is true then it does not exist. There has been no theDate form variable or querystring variable submitted to the server or it contains an emtpy value. your problem is somewhere other than the code you posted.

-pete

 
Two other issues:
1) you will need some sort of quotes or delimiters around the dat in the SQL string, to my knowledge this is required by every ER Db
2) You will need a space before the and in your sql statement, otherwise you will confuse the db when the dat runs into the "and"

There shouldn't be an issue with the case. There shouldn't be an issue with the number of times you call it.

Try assigning both sql statements to variables and printing them out for comparison.

-Tarwn



01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top