SQL Syntax - PLEASE HELP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: SQL Syntax - PLEASE HELP

  1. #1
    Join Date
    May 2005
    Posts
    4

    VB SQL Syntax - PLEASE HELP

    Can someone please tell me why I keep getting this error when running this sql statement:
    Invalid syntax near '.'.

    SQL1 = "SELECT dbo.PAYROLLDB_EMP.ENAME, dbo.PAYROLLDB_EMP.DEPARTMENT, dbo.PAYROLLDB_JBDES.DESCRIPT" & _
    "FROM dbo.PAYROLLDB_EMP INNER JOIN dbo.PAYROLLDB_JBDES ON SUBSTRING(dbo.PAYROLLDB_EMP.CURPOS,6,5) = SUBSTRING(dbo.PAYROLLDB_JBDES.JOBNUM,5)" & _
    "WHERE [DEPARTMENT] = " & Depts.Text

  2. #2
    Join Date
    May 2005
    Posts
    12
    i am only guessing here, but shouldn't it be spaced a bit?
    here
    " WHERE
    and here
    " FROM
    ?

    (otherwise it's just a long word, as in - dbo.PAYROLLDB_JBDES.DESCRIPTFROM)

    my knowledge in syntax is very limited can't help you more than that

  3. #3
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392
    If the above doesn't help, repost your command string in this thread with the command encased in CODE tags so it's formated correctly for us to view...
    Bob Rouse
    Dimension Data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center