TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Riddhi Valecha
443
3.3k
413.1k
SQL Server - Comparing records with current month and year
Apr 16 2021 10:29 AM
Hello Team,
I need help in making a SQL Query again.
I have two tables -
1. Asset Master
ID
UserName
SerialNumber
AssetType
Active
1
Rohit
S1224
CPU
1
2
Janvi
S45677
CPU
1
3
Rohit
S76544
Laptop
1
4
Rohit
S34567
iPAD
1
5
Janvi
S98778
Laptop
1
6
Janvi
S567890
Mobile
1
2. Table - Asset Certification -
ID
SerialNumber
CertifiedBy
CertifiedOn
Active
1
S1224
Rohit
2021-02-03
1
2
S34567
Rohit
2021-02-03
1
3
S98778
Janvi
2021-04-16
1
4
S76544
Rohit
2021-04-16
1
5
S1224
Rohit
2021-01-01
1
6
S98778
Janvi
2021-01-01
1
7
S76544
Rohit
2021-03-02
1
8
S76544
Rohit
2021-03-01
1
Now, I need to load all the assets that are not certfied in the current month and year from table Asset Certication.
E.g. Current Month and YEar - April 2021.
So, I need all detail from Master table - UserName, AssetType, SerialNumber and all records from Asset Certification table - where CertifiedOn is not - April 2021 (highlighted in yellow colour).
Please guide - How do I make the query ?
Reply
Answers (
5
)
con.Open() why not working?
How to convert index from scan to seek?