Solved

String SQL

Posted on 2000-05-14
7
147 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Window placement 17 75
VBA error replacing data 6 37
Exit a vb6 apps when a calling it apps closes 15 43
how to know if my Checkbox is True in VB6.0? 9 38
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

21 Experts available now in Live!

Get 1:1 Help Now