I want to match user profile (Qualification and age) with posted job(Qualification,age) but user emal should be currently logged in user "session["user"]".
But In my query it is showing all the details matching with all user in Job_Seeker_Profile table ..it is not showing result for logged in user.
CREATE TABLE [dbo].[Job_Seeker_Profile] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[js_name] VARCHAR (50) NOT NULL,
[js_address] VARCHAR (50) NOT NULL,
[Contact] VARCHAR (50) NOT NULL,
[email] VARCHAR (50) NOT NULL,
[tenth] VARCHAR (50) DEFAULT ((0)) NULL,
[twelve] VARCHAR (50) DEFAULT ((0)) NULL,
[graduate] VARCHAR (50) DEFAULT ((0)) NULL,
[Qualification] VARCHAR (50) NULL,
[Gender] VARCHAR (50) NULL,
[DOB] DATE NULL,
[JS_age] INT DEFAULT ((0)) NULL,
[Diploma] VARCHAR (50) DEFAULT ((0)) NULL,
[Masters] VARCHAR (50) DEFAULT ((0)) NULL,
[Phd] VARCHAR (50) DEFAULT ((0)) NULL,
[Bio] VARCHAR (50) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
CREATE TABLE [dbo].[Post_job_details] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Job_title] VARCHAR (100) NULL,
[Company_name] VARCHAR (100) NOT NULL,
[Salary] VARCHAR (50) NOT NULL,
[Skills] VARCHAR (MAX) NOT NULL,
[Qualification] VARCHAR (MAX) NOT NULL,
[Details] VARCHAR (MAX) NULL,
[Experience] VARCHAR (50) NULL,
[email] VARCHAR (50) NOT NULL,
[Location] VARCHAR (MAX) NULL,
[Last_Apply_date] DATE NULL,
[City] VARCHAR (50) NULL,
[Age] VARCHAR (50) NULL,
[State] VARCHAR (50) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
SELECT Id,Job_title,Company_name,Salary,Location,State,City,Qualification,Age FROM Post_job_details WHERE Qualification IN (select Qualification from Job_Seeker_Profile) OR Age In (Select JS_age from Job_Seeker_Profile) and CONVERT(DATE,Last_Apply_date)>CONVERT(Date,GETDATE()) or CONVERT(DATE,Last_Apply_date)=CONVERT(Date,GETDATE())and email='jobtest@gmail.com'