Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQL Statement in Excel VBA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    SQL Statement in Excel VBA

    Hi This statement works ( I generated it with MS Query) Why would it not work if I remove the - Chr(13) & "" & Chr(10) & - line. What is it and why does VBA need it?
    Code

    Leave a comment:


  • Guest's Avatar
    Guest replied
    SQL Statement in Excel VBA

    Leave a comment:


  • Guest's Avatar
    Guest replied
    SQL Statement in Excel VBA

    If you remove those (Chr(13) & "" & Chr(10) and place a space before the " at the end of the previous line it should work. Those characters insert a line feed. If you remove those without inserting the blank space, the lines will be concatenanted with no space like; SELECT BAL.BITNO, BAL.AVAL, BAL.VST, MAS.MMITNO,MAS.MMFUDS, MAS.MMDCCDFROM ST.T.BAL BAL, ST.T.MAS MASWHERE BAL.MBITNO = MAS.MMITNO AND ((BAL.MBAVST>0))
    Code

    Leave a comment:


  • M.Savino
    replied
    SQL Statement in Excel VBA

    You can look it up here: http://www.lookuptables.com/ But I think a space after the last quoted string on each line would do the same thing. Without one of those, it looks like your SQL Statement would all run together. Sort of like this: Select Fld1From File1Where Fld1 = 0 Mike

    Leave a comment:


  • J.Wells
    started a topic SQL Statement in Excel VBA

    SQL Statement in Excel VBA

    I think this simply forces a new line. I suspect when you remove these lines, it is causing the select statement to run together (i.e. MAS.MMDCCDFROM ST.T.BAL ). Try putting a space after MAS.MMDCCD and ST.T.MAS MAS. HTH, Joe
Working...
X