我正在尝试从两个表中获取一个表,但我需要在没有时间的情况下将记录同步到同一时间
select *
from Transactions , SellerIPLogins
where Transactions.SellerId =SellerIPLogins.SellerId
and Transactions.SellerId=3141 and Transactions.Payment>1
and **Transactions.Date=SellerIPLogins.Date**
order by Transactions.Date desc
答案 0 :(得分:1)
使用Convert方法将日期时间转换为日期:
select *
from Transactions , SellerIPLogins
where Transactions.SellerId =SellerIPLogins.SellerId
and Transactions.SellerId=3141 and Transactions.Payment>1
and Convert(date,Transactions.Date)=Convert(date,SellerIPLogins.Date)
order by Transactions.Date desc