Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello users ,
i have to create a querry in sql server .
there is a table user name having column
1.username
2.date
i have to find the record that has not enterd records in his table from 2 days of current date.
condition is record sholud not be repited
Posted

select distinct(username) from table
 
Share this answer
 
You can use DISTINCT to avoid duplicate records & you can use DATEADD() to manipulate with your SELECT statement for Date values.
I have given Sample query so write yourself for your need
SQL
SELECT  DISTINCT(UserName) FROM TableUser WHERE [Date] < SELECT DATEADD(DAY,1,GETDATE())
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900