A Funky ASP/SQL "opportunity"

Thread Solved

Join Date: Feb 2005
Posts: 2
Reputation: TheBiochemist is an unknown quantity at this point 
Solved Threads: 0
TheBiochemist TheBiochemist is offline Offline
Newbie Poster

A Funky ASP/SQL "opportunity"

 
0
  #1
Jul 6th, 2005
Hello all -
I've got an interesting problem that I can't seem to solve, so any input on this would be greatly appreciated.
I have a group of web pages. I'm passing several variables back and forth between those pages successfully. One of the variables is called sntime. Essentially, it's a store number. So if it's store 1, I see information out of a table where the store number is equal to 1. This works great. Now here's my question. I'm needing a query that will allow me to pull a recordset out of a dynamic table name. For example, say I have a different pricing table for three stores named pricing_1, pricing_2 and pricing_3 respectively. How can I write a query that will allow me to use the variable I'm passing in between the pages? Something like "Select * from pricing_" + sn +" where store_num= '" &sn& "'". If I use a static table name, the query's always work fine. Somthing like "Select * from table_1 where store_num= '" &sn& "'". Is this type of query possible? As previous stated, any input would be greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 2
Reputation: TheBiochemist is an unknown quantity at this point 
Solved Threads: 0
TheBiochemist TheBiochemist is offline Offline
Newbie Poster

Re: A Funky ASP/SQL "opportunity"

 
0
  #2
Jul 6th, 2005
All -
I have resolved my own issue. Here's the query I used to achieve my desired results:

"SELECT * FROM pricing_" + sn +" where sku='123456'"

I can dynamically call the serial code number (sku) via passing variables between pages. But the dynamic pricing structure really through me for a loop. Just wanted to let everyone know the problem had been resolved.

Best wishes to all and happy ASP coding!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: blitz123 is an unknown quantity at this point 
Solved Threads: 0
blitz123 blitz123 is offline Offline
Newbie Poster

Re: A Funky ASP/SQL "opportunity"

 
0
  #3
Jan 1st, 2007
Originally Posted by TheBiochemist View Post
All -
I have resolved my own issue. Here's the query I used to achieve my desired results:

"SELECT * FROM pricing_" + sn +" where sku='123456'"

I can dynamically call the serial code number (sku) via passing variables between pages. But the dynamic pricing structure really through me for a loop. Just wanted to let everyone know the problem had been resolved.

Best wishes to all and happy ASP coding!
Best Wishes and Happy 2007
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC