Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I have two tables.
 
Faculty_Code Text (Table Name Faculty_Details)
 
Records in the Faculty_Details as follows;
 
Faculty_Code
 
GS
MK
CK
NR
 

Another Table (Table Name Schedule_Details)
 
Faculty_Code
 
GS
Mk
SJ
PN
 
then in the run mode in the combo box all the Faculty_Code from Faculty_Details( table) will display in the combo box.
 
in combo box Faculty_Code as follows from the table Faculty_Details.
 
GS
MK
CK
NR
 
Then i have one button called View.
 
when user select Faculty_Code GS (the Gs Faculty_Code is there in the both the table) from the combo box and click the view button.
 
i want to show the message the select faculty is there.please select different faculty.
 
how to write the query to compare two tables and similar columns in MS Access Database.
Posted 31-Jan-13 3:06am
Comments
Wasim1989 at 31-Jan-13 9:17am
   
you can select count(*) as count from Schedule_Details where Faculty_Code = 'your faculty_Code(combobox value)';
then check count if count greaterthen 0 it means FacultyCode exists and show your message.
hemantrautela at 31-Jan-13 9:26am
   
not getting well,
 
show your code which you tried...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try this.
select count(*) as count from Schedule_Details where Faculty_Code = 'your faculty_Code(combobox value)
then check count value. if count greater-then 0 it means FacultyCode exists and show your message.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 510
1 CPallini 330
2 OriginalGriff 225
3 George Jonsson 120
4 ChauhanAjay 104
0 OriginalGriff 6,474
1 Sergey Alexandrovich Kryukov 6,190
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100