Solved

String SQL

Posted on 2000-05-14
7
180 Views
Last Modified: 2010-05-02

Please, what is wrong with this string:

strMA = tmes.Text
strM = Left(strMA, InStr(1, trMA, "/") - 1)

strA = Mid(strMA, InStr(1, strMA, "/") + 1)

cod = txtcodi.Text

strSQL = "SELECT DISTINCTROW Estag.Name, VD.History,"
strSQL = strSQL & " Pag.CodVenc, Pag.Val, Pag.CodEstag, Pag.MesAno,"

strSQL = strSQL & " FROM VD INNER JOIN (Estag INNER JOIN Pag ON Estag.CodEstag = Pag.CodEstag)"

strSQL = strSQL & " ON VD.CodVenc = Pag.CodVenc"

strSQL = strSQL & " WHERE Pag.CodEstag =" & cod

strSQL = strSQL & " AND Month(MA) = " & strM & " AND Year(MA) = " & strA
strSQL = strSQL & " ORDER BY Nome"
   
Data2.RecordSource = strSQL
Data2.Refresh
0
Comment
Question by:JorgeLuis
[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
7 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 10 total points
ID: 2808768
You've got an extra comma after Pag.MesAno...

For *5* points that more help than your post deserves!

M
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2808815
be careful mark...first question he asked here I gave a perfectly good answer and got a big fat 'C' for it. i dont get it, people come here to ask questions b/c they obviously couldnt figure it out on their own...and then upon getting a solution, they have the nerve to be critical about the working solution they received?  i think this is a possible topic for another one of your lounge discussions  =)
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2809096
Some folx don't read the fine print (or english isn't their first language) and they don't understand it doesn't cost anything to give an 'A'. But *5* points without a claim of "poverty" is just plain *cheap*!

I think you're right, that might make a good lounge Q! :-)

M
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:StingRaY
ID: 2809643
8-)
Hi mark , Hi AzraSound....<-- Just say Hi to you two... 8-)

JorgeLuis.

ORDER BY Nome <--??
or ORDER BY Name ???

5 points??...
ho ho ho
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2810362
StingRaY, most of the fields looked "foreign". I let the oddball spellings slide... :-)

M
0
 
LVL 1

Expert Comment

by:jjsc
ID: 2811437
From the name (JorgeLuis) and the names of the DB fields used, I would say the language is Portuguese. In that case the statement "ORDER BY Nome" is valid (Nome is Portuguese for Name :-)

As for the rest (points etc.) no comment :-)

0
 

Author Comment

by:JorgeLuis
ID: 2812726
Adjusted points from 5 to 10
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

717 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