Sourabh Dhiman

Sourabh Dhiman

  • 1.3k
  • 442
  • 10.2k

Query in sql

May 10 2023 10:25 AM

Hello everyone I have two tables named as au.aspnetusers and au.aspnetuserclaims .I have taken the data from both these tables and joined tables and joined on the base.

select * from au.AspNetUsers  Join Au.AspNetUserClaims ON Au.AspNetUserClaims.UserId=Auth.AspNetUsers.Id
Where (Au.AspNetUserClaims.ClaimType='TrialEndOn' AND CONVERT(varchar(10), Au.AspNetUserClaims.ClaimValue,111) > CONVERT(varchar(100),GETDATE(),120))
AND (Au.AspNetUserClaims.ClaimType='TrialStatus' AND Au.AspNetUserClaims.ClaimValue='inactive')
I have used this query it's return data .


But this query not retrun any result it's just return 0

select * from au.AspNetUsers  Join Au.AspNetUserClaims ON

Au.AspNetUserClaims.UserId=Auth.AspNetUsers.Id
Where (Au.AspNetUserClaims.ClaimType='TrialEndOn' AND CONVERT(varchar(10), Au.AspNetUserClaims.ClaimValue,111) > CONVERT(varchar(100),GETDATE(),120))
AND (Au.AspNetUserClaims.ClaimType='TrialStatus' AND Au.AspNetUserClaims.ClaimValue='inactive')


Answers (5)