Query to select record greater than or equal to Current Date in SQL Server

Last Reply 15 days ago By pandeyism

Posted 16 days ago

I am trying to show qualification and skills that match with user profile but last date of apply should be greater than today but it is showing data having date less than today.

SELECT Id,Job_title,Company_name,Salary,Location,City,Qualification,Age,Last_Apply_date FROM Post_job_details WHERE Qualification IN (select Qualification from Job_Seeker_Profile) OR Age In (Select JS_age from Job_Seeker_Profile) and email='job@gmail.com' and Last_Apply_date>=GETDATE()

 

4	IT Job	company	2000	Asp.Net C#	Graduate	Good command on web development in asp.net c#	2 Year	company@gmail.com	anand	10/12/2019	Anand	24
6	IT Job2	company	2000	Android	Graduate	Good command on web development in asp.net c#	2 Year	company@gmail.com	anand agriculture university	8/30/2019	Ahmedabad	21
7	test job	company	5000	Android	Masters	Good command on web development in asp.net c#	7 Year	company@gmail.com	anand agriculture university	8/31/2019	Rajkot	22
10	date check job2	company	13000	Php	Masters	Good command.	2 Year	company@gmail.com	anand	8/21/2019	Gandhinagar	23
11	date check job new	company	13000	Android	Masters	Good command.	5 Year	company@gmail.com	anand agriculture university	8/23/2019	Rajkot	24
14	Web Development	Exceliot Technologies Private Limited	2000	Asp.Net C#	Graduate	Good command on web development in asp.net c#	2 Year	ETP@gmail.com	503,Ganesh Residency,Opp Krishna Bungalo Gandhinagar Highway Cross road, Motera	8/31/2019	Ahmedabad	25
15	Machine Learning	Episodiclabs Private Limited	10000	Machine Learning (ML)	Masters	Selected Person's day-to-day responsibilities include understanding and implementing test models in TensorFlow, Caffe, etc. 	5 Year	Epipv@gmail.com	401-C Shrinand Nagar Vibhag -2 Vejalpur, Makarba Road, Vejalpur Ahmedabad	9/5/2019	Ahmedabad	25

 

 

You are viewing reply posted by: pandeyism 15 days ago.
Posted 15 days ago

Hi itsme,

Refer below sample query.

SQL

DECLARE @tblJob AS TABLE(Id INT,
                         Jobtitle VARCHAR(50),
                         Company_Name VARCHAR(50),
                         Salary VARCHAR(50),
                         Skills VARCHAR(50),
                         Qualification VARCHAR(50),
                         Details VARCHAR(MAX),
                         Experience VARCHAR(50), 
                         email VARCHAR(MAX),
                         location VARCHAR(50),
                         Last_Apply_Date DATE,
                         City VARCHAR(50),
                         Age VARCHAR(50)
                        )
INSERT INTO @tblJob VALUES(4,'IT Job','company','2000','Asp.Net C#','Graduate','Good command on web development in asp.net c#','2 year','company@gmail.com','anand','10/12/2019','Anand','24')
INSERT INTO @tblJob VALUES(6,'IT Jo2','company','2000','Android','Graduate','Good command on Adnroid app development','2 year','company@gmail.com','anand agriculture university','8/30/2019','Ahmedabad','21')
INSERT INTO @tblJob VALUES(7,'test job','company','5000','Android','Masters','Good command on Adnroid app development','7 year','company@gmail.com','anand agriculture university','8/31/2019','Rajkot','22')
INSERT INTO @tblJob VALUES(10,'date check job2','company','13000','PHP','Masters','Good command on web app development','2 Year','company@gmail.com','anand agriculture university','8/21/2019','Gandhinagar','23')
SELECT Skills, Qualification ,Last_Apply_Date FROM @tblJob
WHERE CONVERT(DATE,Last_Apply_Date)>=CONVERT(DATE,GETDATE())

Output

Skills Qualification Last_Apply_Date
Asp.Net C# Graduate 12.10.2019 00:00:00