Solved

String SQL

Posted on 2000-05-14
7
138 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
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now