Click here to Skip to main content
15,887,980 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony30-May-16 17:35
Raabi Anony30-May-16 17:35 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Mycroft Holmes30-May-16 19:08
professionalMycroft Holmes30-May-16 19:08 
GeneralRe: Dynamic SQL generation is not supported against multiple base tables Pin
Raabi Anony31-May-16 17:40
Raabi Anony31-May-16 17:40 
Questionadding values into a vb6 multiple-column list-box manually (in design time) Pin
Member 1250518129-May-16 9:27
Member 1250518129-May-16 9:27 
AnswerRe: adding values into a vb6 multiple-column list-box manually (in design time) Pin
Dave Kreskowiak29-May-16 18:42
mveDave Kreskowiak29-May-16 18:42 
AnswerRe: adding values into a vb6 multiple-column list-box manually (in design time) Pin
CHill601-Jun-16 0:50
mveCHill601-Jun-16 0:50 
QuestionAliasing Fieldnames and adding a calculation Field Pin
Raabi Anony27-May-16 18:10
Raabi Anony27-May-16 18:10 
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
CHill6028-May-16 3:19
mveCHill6028-May-16 3:19 
To answer your second question first ...
You can give each table a short alias by just including that alias after the table name in the query, or by using AS aliasname. For example you can use either
SQL
FROM tblStaffInfo AS A 
INNER JOIN tblCampuses AS B  ON A.CampusID = B.CampusID  
INNER JOIN tblStaffEvaluation AS C 	ON C.StaffID = A.StaffID
or
SQL
FROM tblStaffInfo A 
INNER JOIN tblCampuses B  ON A.CampusID = B.CampusID  
INNER JOIN tblStaffEvaluation C 	ON C.StaffID = A.StaffID

Once you have given a table an alias you can then no longer use the tablename to qualify which fields you want - you must use the alias. For example, this query
SQL
SELECT A.StaffName, tblCampuses.CampusName,
	LessonPlanning, LessonPreprn, Regularity,
	((LessonPlanning + LessonPreprn + Regularity) / 3) AS AvgScore
FROM tblStaffInfo  A 
INNER JOIN tblCampuses  B  ON A.CampusID = B.CampusID  
INNER JOIN tblStaffEvaluation  C 	ON C.StaffID = A.StaffID
ORDER BY A.StaffName
will generate the error
Quote:
Msg 4104, Level 16, State 1, Line 24
The multi-part identifier "tblCampuses.CampusName" could not be bound.
It should be B.CampusName.

For the first part of your question you will have to explain to us what "The above Sql shows hatred for the division (/) sign" means. There is no error generated by your query and if the fields are defined as INT on the table schema then it gives the correct results. You will get strange results if you have stored those scores as char or varchar fields.
AnswerRe: Aliasing Fieldnames and adding a calculation Field Pin
Dave Kreskowiak28-May-16 3:30
mveDave Kreskowiak28-May-16 3:30 
GeneralRe: Aliasing Fieldnames and adding a calculation Field Pin
Raabi Anony29-May-16 17:11
Raabi Anony29-May-16 17:11 
QuestionExcel view to datagridview migration Pin
Member 476123426-May-16 20:37
Member 476123426-May-16 20:37 
AnswerRe: Excel view to datagridview migration Pin
Richard MacCutchan26-May-16 21:18
mveRichard MacCutchan26-May-16 21:18 
GeneralRe: Excel view to datagridview migration Pin
Member 476123426-May-16 22:19
Member 476123426-May-16 22:19 
GeneralRe: Excel view to datagridview migration Pin
Member 476123426-May-16 22:19
Member 476123426-May-16 22:19 
GeneralRe: Excel view to datagridview migration Pin
Richard MacCutchan26-May-16 22:52
mveRichard MacCutchan26-May-16 22:52 
QuestionWHERE clause of SELECT command Pin
Raabi Anony25-May-16 21:11
Raabi Anony25-May-16 21:11 
AnswerRe: WHERE clause of SELECT command Pin
Raabi Anony25-May-16 21:19
Raabi Anony25-May-16 21:19 
GeneralRe: WHERE clause of SELECT command Pin
Richard Deeming26-May-16 2:03
mveRichard Deeming26-May-16 2:03 
QuestionHow to populate data in combobox gridview in VB.net? Pin
kishore-201625-May-16 11:32
kishore-201625-May-16 11:32 
AnswerRe: How to populate data in combobox gridview in VB.net? Pin
Richard MacCutchan25-May-16 21:03
mveRichard MacCutchan25-May-16 21:03 
GeneralRe: How to populate data in combobox gridview in VB.net? Pin
kishore-20165-Jun-16 10:20
kishore-20165-Jun-16 10:20 
GeneralRe: How to populate data in combobox gridview in VB.net? Pin
Richard MacCutchan5-Jun-16 21:24
mveRichard MacCutchan5-Jun-16 21:24 
QuestionDGV with multiple Tables Pin
Raabi Anony23-May-16 17:41
Raabi Anony23-May-16 17:41 
AnswerRe: DGV with multiple Tables Pin
Mycroft Holmes23-May-16 19:53
professionalMycroft Holmes23-May-16 19:53 
SuggestionRe: DGV with multiple Tables Pin
Richard Deeming24-May-16 1:34
mveRichard Deeming24-May-16 1:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.