select * from [dbo].[database] where UploadDate >= Convert(nvarchar(10), getdate() - 1, 101)
var yesterday = DateTime.Today.AddDays(-1); string cmdstr = "select * from [dbo].[database] where UploadDate = 'yesterday' ";
SELECT DateAdd("d", -1, Date()) As Yesterday;
var yesterday = DateTime.Today.AddDays(-1); string cmdstr = "select * from [dbo].[database] where UploadDate = @value"; SqlCommand cmd = new SqlCommand(cmdstr, conn); cmd.Parameters.AddWithValue("@value", yesterday);
SELECT * FROM MyTable WHERE DATEDIFF(d, UploadDate, GETDATE()) = 1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)