User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,711 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,410 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 2177 | Replies: 2 | Solved
Reply
Join Date: Feb 2005
Posts: 2
Reputation: TheBiochemist is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
TheBiochemist TheBiochemist is offline Offline
Newbie Poster

Solution A Funky ASP/SQL "opportunity"

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Posts: 2
Reputation: TheBiochemist is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
TheBiochemist TheBiochemist is offline Offline
Newbie Poster

Solution Re: A Funky ASP/SQL "opportunity"

  #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  
Join Date: Jan 2007
Posts: 5
Reputation: blitz123 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
blitz123 blitz123 is offline Offline
Newbie Poster

Re: A Funky ASP/SQL "opportunity"

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 6:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC