Whats Wrong with this SQL Statement... - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Whats Wrong with this SQL Statement...

black gerbil1 Avatar
7y, 10m agoPosted 7 years, 10 months ago
Im getting an error

statement below.
Tags:
black gerbil1 Avatar
7y, 10m agoPosted 7 years, 10 months ago
Options

All Comments

(8) Jump to unreadPost a comment
Comments/page:
#1
This is the statement
MyStringBuilder.Append("SELECT tblHRData.EmployeeID AS ID, tblHRData.Title, tblHRData.Fname AS Firstname, ")
MyStringBuilder.Append("tblHRData.Lname AS Surname, tblJobTitle.JobTitle")
MyStringBuilder.Append("FROM (tblHRData INNER JOIN tblJobTitle ON tblHRData.JobID = tblJobTitle.JobID)")
MyStringBuilder.Append("ORDER BY tblHRData.Lname")



This is the error im getting
Syntax error (missing operator) in query expression 'tblJobTitle.JobTitleFROM (tblHRData INNER JOIN tblJobTitle ON tblHRData.JobID = tblJobTitle.JobID)ORDER BY tblHRData.Lname'.
1 Like #3
Don't know mysql very well but if you are bulding it dyamically do you not require a space in between the column and the FROM ie.
'tblJobTitle.JobTitle FROM not 'tblJobTitle.JobTitleFROM

Doubt it will work but maybe worth a go
#4
thedish
Don't know mysql very well but if you are bulding it dyamically do you not require a space in between the column and the FROM ie.
'tblJobTitle.JobTitle FROM not 'tblJobTitle.JobTitleFROM

Doubt it will work but maybe worth a go


hi thanks it worked. I have gave you rep points, Thank you Thedish.:thumbsup:
#5
another one...

MyStringBuilder.Append("SELECT ArtistID, Artist, Category FROM tblArtists")
MyStringBuilder.Append("ORDER BY ArtistID")


I got this error

Syntax error in FROM clause.
1 Like #6
Again, put a space character at the end of the first string "SELECT ArtistID, Artist, Category FROM tblArtists " or at the beginning of the second " ORDER BY ArtistID".

BFN,

fp.
#7
fanpages
Again, put a space character at the end of the first string "SELECT ArtistID, Artist, Category FROM tblArtists " or at the beginning of the second " ORDER BY ArtistID".

BFN,

fp.


I got it done in the end, I didn't need to use the append builder, but thanks for the help fanpages, Have repped you for effort and help.
#8
black gerbil1
I got it done in the end, I didn't need to use the append builder, but thanks for the help fanpages, Have repped you for effort and help.


You're very welcome.

Happy coding...

BFN,

fp.

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!