Hello all

In my table mytable I have Date column.
how is the query to find the nearest date in mytable to current date ?

thank you
denny

Recommended Answers

All 4 Replies

what exactly you are storing in the table ?

table structure please.

select * from mytable order by abs(mydate-sysdate)

hello
I have tried Ultrivedi answer but it didn't work.
This is mytable structure

Field Type

Date1 datetime
Info varchar(50)

thank you

hello all

My question solved
ultivredi's answer solve my problem .only need () following sysdate

thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.