D
D
Dima2017-07-28 12:03:22
SQL
Dima, 2017-07-28 12:03:22

Date sort in SQL?

I am writing WEB.API using EF. Actually there is a DB in which there is a column 'Date' (screen). How to sort so that the date "Today and later" is displayed and dates that have already passed are not displayed?
0586bde080574b0b848199373b05ee10.jpg6891cb743de54db99e08d93459083ac7.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kovalsky, 2017-07-28
@NekOdin

If it's EF, then maybe justwhere date > DateTime.Now

D
Dmitry Ponomarev, 2017-07-28
@dimker

This is?

DECLARE @curdate date 
SELECT INTO @curdate CAST(CURRENT_TIMESTAMP as date)

SELECT * 
FROM t
WHERE Date >= @curdate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question