Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Query Syntax Error

Posted on 2009-07-07
2
Medium Priority
?
270 Views
Last Modified: 2013-11-16
Hello.

I need to make a dynamic query to RSMain based on the RSIndex id_indexador. But its not working this way...

Please help!

Thanks in advance!

comando = "SELECT * FROM tbl_Indexador" 
call abrers(comando, "listar", RSIndex)
 
DO WHILE NOT RSIndex.EOF 
comando = "SELECT * FROM tbl_Cotacao where dt_cotacao = '"&dt&"' and id_indexador = "& RSIndex("id_indexador")
call abrers(comando, "listar", RSMain&RSIndex("id_indexador"))
RSIndex.MoveNext
loop

Open in new window

0
Comment
Question by:drix76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24793335
what about combining this into 1 query:
comando = "SELECT * FROM tbl_Cotacao where dt_cotacao = '"&dt&"' and id_indexador IN ( select id_indexador FROM tbl_Indexador ) "
call abrers(comando, "listar", RSIndex)

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24793340
apart from that: what error do you get, on which line, etc ..?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question