?
Solved

String SQL

Posted on 2000-05-14
7
Medium Priority
?
184 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 40 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
Industry Leaders: 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

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!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

762 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