实际上我想要我的数据库中的一些记录。有一个领域Time_From
。我只想显示那些之后的记录DateTime.Now()
。但它没有显示,它显示之前和之后的记录DateTime.Now()
Select *
from mytable
where Vehicle_Booking_Date= @Vehicle_Booking_Date
AND Time_From > @Time_From order by Time_From"
表定义(来自评论)
CREATE TABLE [dbo].[mtblVehicle_Booking]
(
[Sno] [int] IDENTITY(1,1) NOT NULL,
[Vehicle_Number] [nvarchar](100) NULL,
[Vehicle_Booking_Date] [datetime] NULL,
[Time_From] [datetime] NULL,
[Time_To] [datetime] NULL,
[Vehicle_Used_By] [varchar](100) NULL,
[Vehicle_Booked_By] [varchar](100) NULL,
[Cost_Code] [nvarchar](50) NULL,
[Budget_Line] [nvarchar](50) NULL,
[Purpose] [varchar](20) NULL,
[Destination] [nvarchar](500) NULL,
[Trip_Details] [nvarchar](500) NULL
)
ON [PRIMARY]